How can we help you today? How can we help you today?

Synchronize AND save script file using command line

I almost have continuous integration setup with TeamCity but have come up with another hitch:

I want to apply the changes to our test database from subversion (using the "/synchronize" switch), AND save the resulting script file as artifacts of the build for future reference (using the "/scriptFile" switch).

When I use both of these switches, SQLCompare tries to write to the script file twice, one for the /scriptFile switch and one for the /synchronize, and outputs an error:

Registering data sources
Creating mappings
Comparing
Applying project settings
Creating SQL
Creating SQL
Error: Unable to write migration script to file '...' because the file already exists.

Is this a bug? Is there a way for me to both synchronize and save a script file without having to run the command line twice?
david.duffett
0

Comments

4 comments

  • Chris Auckland
    Thanks for your post.

    I've just tried to recreate this and I was able to use both /scriptfile and /sync together.

    Did you set the /force switch so that you can overwrite the existing script file?

    If this doesn't help, can you post the command you are using?
    Chris Auckland
    0
  • david.duffett
    Using the "/force" switch with the other switches works a treat - I no longer get the error message and changes are synchronised and save to the script file.

    Thanks a lot - now all I need to SQL Source Control to allow my devs to source control data!
    david.duffett
    0
  • David Atkinson
    We're hoping to put static data support in SQL Source Control in the next major release. In the meantime you'll have to do this via SQL Data Compare Pro:

    http://www.red-gate.com/supportcenter/C ... aspx?p=SQL Source Control&c=SQL_Source_Control/help/1.0/SSC_Source_Controlling_Data.htm&toc=SQL_Source_Control/help/1.0/toc.htm

    If you try this, you'll need the latest patched build:

    http://www.red-gate.com/MessageBoard/vi ... hp?t=10917

    Regards,

    David
    David Atkinson
    0
  • AndrewRMClarke
    I got the same problem with SQL Compare v 8. It writes the file out when it does the comparison, and then tries to write it out again a second time, but aborts when it finds to its surprise that the file is already there. If you nick out the /synchronize switch it seems to work.
    AndrewRMClarke
    0

Add comment

Please sign in to leave a comment.