SQL Compare

Latest version: 10.0

SQL Compare

Knowledge Base

HTML reports are generated for identical comparisons

Category: Troubleshooting & error messages
Date: 30 Jan 2009
Product: SQL Compare
SQL Compare - All Versions

If you are using the SQL Compare command line interface to automate schema comparison and report generation, you may have noticed that a report is still generated when the schemas are identical.

Currently it is not possible to set the job to only create the report if the schemas are different, as the report will be generated before the error code indicating no differences is returned. This results in a somewhat unhelpful blank report being created in the folder.

As a possible workaround, you could configure the batch file to delete the report if the schemas are identified as identical. .

Errorlevel 63 will be returned if the schemas are the same, which can be used to delete the report. Here is an example batch file:

---------------------------------------

"C:\program files\red gate\sql compare 7\"sqlcompare /s1:(local) /s2:(local) /db1:TempA /db2:TempB /report:"E:\Temp\SQL Compare Reports\report.html" /rt:simple /force

IF %ERRORLEVEL% == 0 GOTO end

IF %ERRORLEVEL% == 63 GOTO identical

:identical

del "E:\temp\SQL Compare Reports\report.html"

:end

------------------------------------------

See SQL Compare command line help for additional error codes.

Document ID: KB200901000345 Keywords: SQL,Compare,report,63,errorlevel

Was this article helpful?

Search support
Forums
Visit the SQL Compare forum.

SQL Compare

all SQL products

all products