当使用vsdbcmd部署我的数据库时:
vsdbcmd.exe /a:Deploy /manifest:MyDatabase.deploymanifest我得到:
SQL01268 .Net SqlClient Data Provider: Msg 50000, Level 16, State 127, Line 6 Rows were detected. The schema update is terminating because data loss might occur. SQL01268 An error occurred while the batch was being executed.
这很好,但它并没有告诉我数据开放将发生在哪里。为了找出我必须使用<DeployToScript>True</DeployToScript>,然后加载脚本以查看:
IF EXISTS (select top 1 1 from [dbo].[MyTable]) RAISERROR ('Rows were detected. The schema update is terminating because data loss might occur.', 16, 127) WITH NOWAIT
是否有一种方法可以让vsdbcmd在直接部署到DB时显示此信息,而不必先生成sql?
谢谢
发布于 2012-01-24 16:48:10
没有办法做到这一点,这是一个bug (或缺少的功能)。见汤姆对我问题的评论。
发布于 2011-09-27 12:02:55
对我来说,在部署SQL之前,我需要清空我的数据库。
https://stackoverflow.com/questions/5898395
复制相似问题