Automating command line tool

rj-guerrarj-guerra Posts: 7
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

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    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.
  • 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
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    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.
  • OK Brian, how can I do a checksum comparison ?
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    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.
Sign In or Register to comment.