Redgate SQLCOmpare 6 Command Line => Return Code is "0" even DB's are identical

225 views Asked by At

We have a NANT scripts which are using for packaging automation. We also comparing previous DB and current DB if any structural and Data changes with SQLCompare command line tool.

Even I compare same database, I can't get exit code "63" which means "two databases are identical". I am getting always exit code "0". How can I control if DBs are identical or not ?

NANT Scripts for SQLCompare :

*<property name="remcom.machine" value="server"/>
    <property name="remcom.user" value="${server.user.administrator}"/>
    <property name="remcom.pwd" value="${server.password.administrator}"/>
    <property name="remcom.workdir" value="${sqlcompare.dir}"/>
    <property name="remcom.command" 
              value="&quot;${sqlcompare.file} /s1:${compare.db.instance}        /u1:${compare.db.user} /p1:${compare.db.pwd} /db1:${db.current} /s2:${compare.db.instance} /u2:${compare.db.user} /p2:${compare.db.pwd} /db2:${db.previous} /f /q /sf:e:\redgateReports\${script.file} /r:e:\redgateReports\${report.file} /rt:Interactive /options:IgnoreWhiteSpace,IgnoreFillFactor,IgnoreFileGroups,IgnoreUserProperties,IgnoreWithElementOrder,ForceColumnOrder,IgnorePermissions,NoSQLPlumbing&quot;"/>
    <call target="RemoteCommand"/>
    <property name="sqlcompare.exitCode" value="${remcom.result}"/>*

THIS IS THE CODE WHICH I AM CONTROLLING THE EXIT CODE :

<property name="compare.failed" value="${sqlcompare.exitCode != '63'}"/>
    <if test="${property::exists('failIfDifferent') and failIfDifferent == 'true'}">
      <fail if="${compare.failed}" message="Exit code is NOT 63.  DB stuctures [  ${db.current} and ${db.previous} ] are NOT identical. see report files in server: ${report.file} " />
    </if>
1

There are 1 answers

0
Ali Bulut On

Thank you for response. I tested my sqlcompare command on my local machine . It didn'T give me "63" code. Then I create a comparison project with sqlcompare and used same options in my command line option list Then it worked fine and now I will test it in our NANT scripts and server.

Best Regards.

Ali Bulut