/assertidentical isnt working as the help in my case
fpdave100
Posts: 12 Bronze 1
in SQL Compare
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?
"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?
Tagged:
Best Answer
-
fpdave100 Posts: 12 Bronze 1I 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
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
Have you visited our Help Center?
Ah, righto, that would do it! Thanks for letting me know!
Kind regards,
Alex
Have you visited our Help Center?