Running bat file

Forum for users of SQL Compare schema synchronization utility

Running bat file

Postby dngds » Wed Feb 26, 2014 4:47 am


I have assumed management of 2 servers and SQL Compare is installed and used to sync instances that are replicated on both servers. Our nightly job runs a bat file that initiates the program. Other than that, I really don't know what it does and furthermore I don't know if there are reports produced in case if the nightly compare has discrepancies.

Can someone please decipher this for me and explain what SQL Compare is asked to do? Here is a sample of the code. Thank you

sqldatacompare /server1:... /database1:abc /username1:... /Password1:... /server2:... /database2:abc /username2:... /Password2:... /sync
Posts: 1
Joined: Wed Feb 26, 2014 4:34 am

Postby Anu Deshpande » Fri Feb 28, 2014 11:48 am

Thanks for your post.

First thing is your's is a SQL Data compare command line command and not SQL Compare.

SQL Compare compares the schema of the two databases where as SQL Data Compare compares the data.

More about them here: SQL Compareand SQL Data Compare

Now looking at your SQL Data Compare command line: It is comparing 2 databases and synchronizing with the default option set.

More information on command line for SQL Compare and SQL Data Compare.

You also asked about any output file/email notification: You can use MAPI to send you email notification. The batch file will look something like this:
Code: Select all

cd c:\\program files\\Red Gate\\SQL Compare 10

SQLCompare /server1:(local) /server2:(local) /database1:WidgetDev /database2:WidgetProd /v /out:"C:\\output.txt" /force



MAPISend -i -r -s "SQL Compare Error" -m "Failed job! Error Code:%Errorlevel%"


Hope this answers all your questions.
Anuradha Deshpande
Product Support
Redgate Software Ltd.
Anu Deshpande
Posts: 838
Joined: Mon Apr 20, 2009 2:53 pm
Location: Cambridge

Return to SQL Compare Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests