Sql Data Compare: Command Line Help
Nirmal
Posts: 2
I want to data compare of two database tables.
if I want to use command line syntex, how to write command line for only compare of two table and insert only new rows in target database table.
if I want to use command line syntex, how to write command line for only compare of two table and insert only new rows in target database table.
Comments
The SQL Data Compare Help File ->Command Line Interface section, contains examples on what you are seeking.
Also if you run the following command line syntax, this will generate further help information:
SQLDataCompare /help /html > CLIHelp.html
This will create a html file called CLIHelp in your SQL Data Compare installtion folder.
An example Command Line Syntax is as follows:
SQLDataCompare.exe /server1:<Server1_Name> /server2:<Server2_Name> /database1:<DB1_Name> /database2:<DB2_Name> /username1:<database1 username> /password1:<password> /username2:<database2 username> /password2:<password> /Include:Table:\[Table1_Name\] /Include:\[Table2_Name\] /sync
The above syntax will compare just the two tables and synchronize them. You cannot set the synchronization to be only the new rows. In that the changes are migrated to <database2> from <database1>, so that the tables selected in the comparison will become identical.
Hope the above information helps.
Many Thanks
Eddie
Senior Product Support Engineer
Redgate Software Ltd
Email: support@red-gate.com
Please disregard this line in my reply:
I forgot about the following options:
/ignoreidentical - Do not compare rows that are the the same in both databases. /ignoredifferent - Do not compare rows that are different in both databases. /ignoremissing - Do not compare rows that are present only in <database1>. /ignoreadditional - Do not compare rows that are only present only in <database2>.
As you only wish to add new rows of data to the target database <database2>, please take a look at the following command line syntax:
In my example syntax above the comparison will only compare and synchronize rows of data that exist in <database1> and rows off data that are different in both databases. If you wish to compare and synchronize the rows of data that exist only in <database1> add the /ignoredifferent argument to my example syntax.
Sorry for the confusion.
Many Thanks
Eddie
Senior Product Support Engineer
Redgate Software Ltd
Email: support@red-gate.com