Running bat file

Compares and synchronizes SQL Server databases, backups and scripts.

Moderators: JonathanWatts, Chris Auckland, David Atkinson, eddie davis, Anu Deshpande, Michelle Taylor, alice.easey, james.billings, chengvoon.tong

Running bat file

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

Hi

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
dngds
 
Posts: 1
Joined: Wed Feb 26, 2014 5:34 am

Postby Anu Deshpande » Fri Feb 28, 2014 12:48 pm

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
C:

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

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

IF %ERRORLEVEL% == 0 GOTO end

:failed

MAPISend -i -r support@somewhere.com -s "SQL Compare Error" -m "Failed job! Error Code:%Errorlevel%"

:end

Hope this answers all your questions.
Anuradha Deshpande
Product Support
Redgate Software Ltd.
E-mail: support@red-gate.com
Anu Deshpande
 
Posts: 692
Joined: Mon Apr 20, 2009 3:53 pm
Location: Cambridge


Return to SQL Compare 10

Who is online

Users browsing this forum: No registered users and 0 guests