使用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时显示此信息?
由于
答案 0 :(得分:0)
没有办法做到这一点,这是一个错误(或缺少功能)。请参阅汤姆对我的问题的评论。
答案 1 :(得分:-1)
对我来说,我需要在部署SQL之前清空我的数据库