0

パッケージの自動化に使用する NANT スクリプトがあります。また、SQLCompare コマンド ライン ツールを使用して、構造およびデータが変更された場合に、以前の DB と現在の DB を比較します。

同じデータベースを比較しても、「2 つのデータベースが同一であること」を意味する終了コード「63」を取得できません。常に終了コード「0」を取得しています。DB が同一かどうかを制御するにはどうすればよいですか?

SQLCompare 用の NANT スクリプト:

*<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}"/>*

これは私が終了コードを制御しているコードです:

<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>
4

1 に答える 1

0

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

于 2011-10-14T10:20:46.410 に答える