Options

Sync data programmatically

kkchankkchan Posts: 33
Hi,
I have defined data sync using sql data compare and save it in project file. I would like to sync data programmatically, with all my configuration saved in project file with only few changes:-

Source/Target Connection Info.

How could I do so?

Thank you

Comments

  • Options
    Thanks for your post.

    The easiest way to sync multiple databases programmatically will be to use the SQL Data Compare 6 command line interface.

    You can then sequentially call a project file for each of the comparisons you need to perform. e.g.

    SQLDataCompare.exe project:"ProjectFile1.sdc" /sync
    SQLDataCompare.exe project:"ProjectFile2.sdc" /sync
    SQLDataCompare.exe project:"ProjectFile3.sdc" /sync

    There is more information on using the command line interface in the helpfile:
    http://help.red-gate.com/help/SQLDataCo ... dLine.html

    If you have a single project file already configured and all you need to change is the server or database used in the connection, I think the simplest way to do this would be to make a copy of the project file, and then edit the file using a text editor. When you open a .sdc file in a text editor you can edit the project file xml and change the database and server that you connect to, or from. When you save the file you will be able to call it from the command line and perform the identical comparison but to/from a different database.

    I hope this answers your question.
    Chris
Sign In or Register to comment.