Automating command line tool

Compares and synchronizes SQL database content.

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

Automating command line tool

Postby rj-guerra » Wed Jun 05, 2013 12:22 pm

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
rj-guerra
 
Posts: 5
Joined: Wed Jun 05, 2013 11:41 am

Postby Brian Donahue » Wed Jun 05, 2013 4:15 pm

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.
Brian Donahue
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am

Postby rj-guerra » Thu Jun 06, 2013 11:54 am

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
rj-guerra
 
Posts: 5
Joined: Wed Jun 05, 2013 11:41 am

Postby Brian Donahue » Fri Jun 07, 2013 9:29 am

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.
Brian Donahue
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am

Postby rj-guerra » Fri Jun 07, 2013 10:32 am

OK Brian, how can I do a checksum comparison ?
rj-guerra
 
Posts: 5
Joined: Wed Jun 05, 2013 11:41 am

Postby Brian Donahue » Mon Jun 10, 2013 9:50 am

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.
Brian Donahue
 
Posts: 6669
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