使用 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 在直接部署到数据库时显示此信息而不必先生成 sql?
谢谢