Redgate SQLCOmpare 6 命令行 =>返回码为“0”甚至 DB 都是相同的
我们有一个用于打包自动化的 NANT 脚本。 我们还使用 SQLCompare 命令行工具比较以前的数据库和当前数据库是否有任何结构和数据更改。
即使我比较相同的数据库,我也无法获得退出代码“63”,这意味着“两个数据库是相同的”。我总是得到退出代码“0”。 如何控制数据库是否相同?
用于 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=""${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""/>
<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>
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=""${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""/>
<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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
谢谢您的回复。我在本地计算机上测试了 sqlcompare 命令。它没有给我“63”代码。然后我使用 sqlcompare 创建一个比较项目,并在命令行选项列表中使用相同的选项
然后它工作得很好,现在我将在我们的 NANT 脚本和服务器中测试它。
此致。
阿里·布鲁特
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