Sql Compare 10.1 Command Line Migration Script Folder

SeriousMSeriousM Posts: 15
edited March 20, 2012 5:26AM in SQL Compare Previous Versions
Hello,

please help me to achieve the following scenario:

Given:
.) Only Sql Compare
.) DataBase scripts in SVN (but not with Sql Source Control)
.) Server: SQL Azure
.) Table: Test1
.) other tables have a relation ship to Test1

I want to rename the table Test1 to Test2.

sql compare 10 (command line!) does not recognize, that i want to rename this table, drops Test1 and creates Test2.
it's clear to me that the sql-c doesn't know what i wan to do but how i can tell sql-c that Test1 'is' Test2?

I've seen that the new version 10.1 does support a /migrationfolder command line option.

Now my questions:
.) Does this command line option helps me in this case?
.) how the files have to be named?
.) do i have to write normal sql commands and sql-c interprets/merges my commands or do i have to write environment specific sql (eg. for sql azure!)?
.) do the commands from the files run in the same transaction as the generated script from sql-c?

.) and WHY there is NO DOCUMENTATION about this feature?! (we are a paying customer!)

thanks in advance,
regards,
Bernhard

Comments

  • Unless you need to run this as part of an automated build process, for a rename you can simply map the tables in the Table Mapping tab of the Edit Project screen in SQL Compare 10.

    Apologies for the documentation issue. Can I ask how and where you looked so we can look into improving this?

    Kind regards,

    David Atkinson
    Red Gate
    David Atkinson
    Product Manager
    Redgate Software
  • Hi David,

    as i have written, i use the (quote:) 'sql compare 10 (comand line!)'.
    we use it in an automate build process for continous integration.
    can you please read the entire post and help me (please)?

    @documentation:
    ive looked at the product page, the support pages, the forum and even the wiki but there is no documentation. you can choose where you want to put more into about this feature.

    thanks in advance
  • Sorry, I missed the command line reference.

    The good news is that the changes you can make in the UI can be stored in a saved project.

    So make the changes I suggested earlier in the SQL Compare UI, save the project (.scp file) and reference this from the command line using:
    sqlcompare.exe /project:<yourproject.scp>
    
    David Atkinson
    Product Manager
    Redgate Software
  • Hi David,

    i was asking for a command line solution for continous integration.
    we do not have the licences to give every developer a sql compare version and this does not solve the problem at all!

    again: please tell me how i can use the migration script folder.
    please read my entire post and then help me (please!).

    i do not want to use the UI and i do not want to use the project file saved by the UI.

    thanks in advance,
    bernhard
  • Why doesn't the solution I gave work for you? You just have to use the UI once to define the mappings required. This produces the project file that can be referenced from the command line.

    If you want to benefit from migration scripts, you will require SQL Source Control, which you have said that you don't use. Besides, I'm not sure this is needed in your scenario.

    David
    David Atkinson
    Product Manager
    Redgate Software
  • Hi David,

    i ask you to understand that we wont use the UI for this task.

    "sql compare 10 console" has the /migrationfolder command line option and all i want to know is how i have to use it.

    i ask you (again) to help me and answer my questions:

    .) how the files in the migration folder have to be named?
    .) do i have to write normal sql commands and sql-c interprets/merges my commands or do i have to write environment specific sql (for sql azure!)?
    .) do the commands from the files run in the same transaction as the generated script from sql-c?

    thanks in advance,
    bernhard
  • Migration scripts (and hence the /migrationfolder option) require you to use SQL Source Control in conjunction with SQL Compare (command line or UI) so this isn't an option for you. SQL Compare cannot leverage migrations scripts without the migrations repository created by SQL Source Control.

    If you want to read more about how this works, please visit the following link:

    http://www.red-gate.com/supportcenter/c ... Migrations

    I'm still struggling to understand why you can't use sqlcompare.exe /project. This only uses the UI once to create the project that includes the table mappings. After this you can just use the command line and reference the project. Is there any reason why you can't create the project?

    David
    David Atkinson
    Product Manager
    Redgate Software
Sign In or Register to comment.