Red Gate forums :: View topic - XML Command Line Switches...
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Data Compare 10
SQL Data Compare 10 forum

XML Command Line Switches...

Search in SQL Data Compare 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
lc6529



Joined: 18 Apr 2007
Posts: 20

PostPosted: Fri May 31, 2013 2:16 pm    Post subject: XML Command Line Switches... Reply with quote

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?
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6676

PostPosted: Fri May 31, 2013 4:04 pm    Post subject: Reply with quote

Hi,
To include missing/different/identical in the XML command file, you can use
Code:
<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:
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
Back to top
View user's profile Send private message
lc6529



Joined: 18 Apr 2007
Posts: 20

PostPosted: Fri May 31, 2013 4:36 pm    Post subject: Getting Closer Reply with quote

So I use

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

AND

<Include>Missing</include>
<Include>Different</include>
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6676

PostPosted: Wed Jun 05, 2013 10:26 am    Post subject: Reply with quote

Yes.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group