XML Command Line Switches...

Compares and synchronizes SQL database content.

Moderators: JonathanWatts, Chris Auckland, David Atkinson, Michelle Taylor, chengvoon.tong

XML Command Line Switches...

Postby lc6529 » Fri May 31, 2013 2:16 pm

I currently have a batchfile calling SQLDATACOMPARE to compare 1 table on two different servers, the target table is only supposed to have rows added or modified NOT deleted so I use the command line options

/Include:Missing /Include:Different /Include:Identical

The reason I use include:identical is I also have the output directed to a log file with a date stamp using command line options.

I am trying to convert this batchfile to use an XML argument file

I am having two problems.

#1: I cannot see how to do /Include:Missing /Include:Differrent
in the XML file

#2: I cannot get a date stamp in my output file, I tried using
/Arfile: [XML filename].XML >> [OutputFileName] but SQLDATACOMPARE did not like that.


Basically I need the XML Equivalent of

set LOG_TIMESTAMP=%date:~4,2%-%date:~7,2%-%date:~10,4%_%time:~0,2%%time:~3,2%

sqldatacompare /s1:Server1 /s2:Server2 /db1:DataBase1 /db2:Database2 /u1:userid1 /p1:password1 /u2:userid2 /p2:password2 /include:table:\\[TableName\\] /Include:Missing /Include:Different /Include:Identical /Out:c:\\OutPutFileName_%LOG_TIMESTAMP%TXT

Does anyone have any suggestions?
lc6529
 
Posts: 20
Joined: Wed Apr 18, 2007 7:32 pm

Postby Brian Donahue » Fri May 31, 2013 4:04 pm

Hi,
To include missing/different/identical in the XML command file, you can use
Code: Select all
<Include>Missing</include>

I take it the second request is to redirect output from SQLDATACOMPARE.exe to a file formatted by date. I believe you can create a batch file using the DATE command...
Code: Select all
REM assuming your dateformat is dd/mm/YYYY!
@For /F "tokens=1,2,3 delims=/ " %%A in ('Date /t') do @(
Set Day=%%A
Set Month=%%B
Set Year=%%C
)
sqldatacompare.exe /argfile:x.xml >> %Day%.%Month%.%Year%.txt
Brian Donahue
 
Posts: 6668
Joined: Mon Aug 23, 2004 10:48 am

Getting Closer

Postby lc6529 » Fri May 31, 2013 4:36 pm

So I use

<include>Table:\\[TableName\\]</include>

AND

<Include>Missing</include>
<Include>Different</include>
lc6529
 
Posts: 20
Joined: Wed Apr 18, 2007 7:32 pm

Postby Brian Donahue » Wed Jun 05, 2013 10:26 am

Yes.
Brian Donahue
 
Posts: 6668
Joined: Mon Aug 23, 2004 10:48 am


Return to SQL Data Compare 10

Who is online

Users browsing this forum: No registered users and 0 guests