Retrieve migration scripts from TFS

jofanonjofanon Posts: 4
What's the best way to retrieve a set of migration scripts (stored in version control using SQL Source Control) and then execute them?

Is there a method somewhere to say retrieve a reference to a set of scripts? Can anyone give me an example?

I don't want to write code that....

Connect to TFS
Get latest scripts
Identify uncommitted scripts
Executes the scripts

There must be a way of doing this through the API?

Comments

  • Hello,

    You should be able to accomplish this by using the SQL Compare (and possibly SQL Data Compare) command line.

    You'll need to create two xml files and reference them from the command line.

    If you go into your extended properties for the database you're working with, you'll notice "SQLSourceControl Scripts Location" and "SQLSourceControl Migration Scripts Location". You'll need to pull the value from SQLSourceControl Scripts Location and create an xml file with that value and also create a separate xml file for the value of SQLSourceControl Migration Scripts Location.

    In your command line, you'll need to include these switches:
    /migrationsfolderxml:filepath for migration scripts xml
    /scriptsfolderxml:filepath for scripts xml

    Here's the documentation page for using the command line for SQL Compare: http://documentation.red-gate.com/displ ... mmand+line

    There are a few less complicated worked examples here: http://documentation.red-gate.com/displ ... mmand+line

    Hope that helps,
    Evan
    Evan Moss
    Product Support
    (866) 627-8107
Sign In or Register to comment.