/assertidentical isnt working as the help in my case

My cmd line is:
"c:\Program Files (x86)\Red Gate\SQL Compare 13\SQLCompare.exe" /ScriptsFolderXML:D:\MISCTOOLS\RUNTEMP\WEB3_DEV_15777\SQLCompare_TFS_DEV_Procurement.xml /Exclude:StoredProcedure:Tradeflow_AP_getCurrentReport_Cache /assertidentical /Sourcecontrol1 /revision1:HEAD  /server2:DEV-2\SQL2014 /db2:web3p2p_devtemplate_Procurement /username2=XX /password2=XXXXX /scriptfile:"D:\MISCTOOLS\RUNTEMP\WEB3_DEV_15777\XXX_Procurement_SCHEMA.sql" /force /report:D:\MISCTOOLS\RUNTEMP\WEB3_DEV_15777\REPORT_Procurement_SCHEMA.html /ReportType:Interactive /options:Default,IgnoreExtendedProperties,IgnoreDatabaseAndServerName,IgnoreWhiteSpace,IgnoreUserProperties,IgnoreWithElementOrder 

We have 10 dbs in our system, and a db set per branch, so I have written a batch file to do certain common comparisons and scrip generations for a db set (ie vs TFS, vs another db).

I'm trying to get reliable info about whether any of the dbs in a set are different to TFS using the cmd line, but finding that errorlevel of 0 is being returned even if they are different!

What is the best way to determine if they are the same or different from a batch file?

Best Answer

  • fpdave100fpdave100 Posts: 9 Bronze 1
    Accepted Answer
    I now have 13.7.16.11325 - just upgraded to very latest

    tracked down the problem!

    it was because I was using a wtee command to pipe output so I could see the output as well as logging it all.

    eg:
    sqlcompare options |wtee -a log.log

    it was giving the error level of the wtee cmd!

    I think I will just redirect as normal, and have to output when done!


Answers

  • Hi @fpdave100,

    The different combinations are (or should be):
    Without the /assertidentical switch, if the two sources are identical it will give you exit code 63; if they are different it will give you exit code 0

    With the /assertidentical switch, if the two sources are identical it will give you exit code 0; if they are different it will give you exit code 79.

    I've just checked and the above behavior occurs for me in the latest version 13.7.21 what version are you using?

    Kind regards,
    Alex
    Product Support Engineer | Redgate Software

    Have you visited our Help Center?
  • Hi @fpdave100,

    Ah, righto, that would do it! Thanks for letting me know!

    Kind regards,
    Alex
    Product Support Engineer | Redgate Software

    Have you visited our Help Center?
  • fpdave100fpdave100 Posts: 9 Bronze 1
    A useful enhancement to sqlcompare would be to support console output + mirrored output to a log file, not just a results file, so that users can see the output + everything is logged for diagnostics etc.
Sign In or Register to comment.