Red Gate forums :: View topic - Automating command line tool
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

Automating command line tool

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



Joined: 05 Jun 2013
Posts: 5

PostPosted: Wed Jun 05, 2013 12:22 pm    Post subject: Automating command line tool Reply with quote

Hi there,

we want to automate the command line tool execution in TeamCity passing in a project file.

How can we check for the comparison execution result ?
From what i see from the documentation, there is an "/assertidentical" switch that should accomplish this task.

But this switch is not displayed in the command-line tool help.
Moreover, i'm getting an "invalid command-line argument: /assertidentical" (passing in project file).

How can this be achieved ?

Thanks in advance!

Cheers,
Ricardo
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6582

PostPosted: Wed Jun 05, 2013 4:15 pm    Post subject: Reply with quote

Hi Ricardo,

I'm sure the information you found must be outdated. Unfortunately they won't let us prune the forums so be careful of the date on anything you find in these forums along with the cobwebs and dust.

If you can let me know what you are trying to accomplish, I should be able to point you at the proper option.
Back to top
View user's profile Send private message
rj-guerra



Joined: 05 Jun 2013
Posts: 5

PostPosted: Thu Jun 06, 2013 11:54 am    Post subject: Reply with quote

Hi Brian, thanks for your reply.

What we're trying to achieve is to integrate data comparison with our automated test process.

We need to write an integration test that calls a feature on our system that changes multiple database tables.

Since asserting multiple conditions is not feasible for this scenario we see that SQL Data Compare integration would be handy.

For that matter, instead of calling multiple asserts, we would run the command-line tool and pass the ".sdc" project file.

Then, we need to check the the tool return code and assert whether the comparison indicates the compared tables are identical or not.

If they are identical it means that the feature is running as expected, if not, the test fails.

Running the command line tool from within the test is fairly simple, i just need to capture the return code then.

The command i think can accomplish this is the following:
SQLDataCompare.exe /project:"data-comparison.sdc" /Include:Identical

So you see this is achievable ?

Thanks!

Ricardo
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6582

PostPosted: Fri Jun 07, 2013 9:29 am    Post subject: Reply with quote

Hello Ricardo,

You will probably want to do the opposite and not use assertidentical or include:identical and just trap %ERRORLEVEL%==63. Error code 63 is returned if the data is equal or there is nothing to compare. This test should also run relatively quickly if checksum comparison is enabled because you don't have to compare all of the data first to see if it is equal.
Back to top
View user's profile Send private message
rj-guerra



Joined: 05 Jun 2013
Posts: 5

PostPosted: Fri Jun 07, 2013 10:32 am    Post subject: Reply with quote

OK Brian, how can I do a checksum comparison ?
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6582

PostPosted: Mon Jun 10, 2013 9:50 am    Post subject: Reply with quote

Checksum comparison is enabled by default for SQL2005 and higher, but you can enable it and disable it in the project options under comparison behavior as well.
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