vsdbcmd可能会发生数据丢失,但是在哪里呢?
使用 vsdbcmd 部署数据库时:
vsdbcmd.exe /a:Deploy /manifest:MyDatabase.deploymanifest
我得到:
SQL01268 .Net SqlClient 数据提供程序:检测到消息 50000,级别 16,状态 127,第 6 行。由于可能会发生数据丢失,架构更新正在终止。 SQL01268 执行批处理时发生错误。
这很好,但它没有告诉我哪里会发生数据丢失。为了找出答案,我必须使用
,然后加载脚本以查看:
IF EXISTS (select top 1 1 from [dbo].[我的桌子]) RAISERROR ('检测到行。架构更新正在终止,因为可能会发生数据丢失。', 16, 127)WITH NOWAIT
有没有办法让 vsdbcmd 在直接部署到数据库时显示此信息,而无需先生成sql?
谢谢
When using vsdbcmd to deploy my database:
vsdbcmd.exe /a:Deploy /manifest:MyDatabase.deploymanifest
I Get:
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.
Which is fine, but it doesn't tell me where the dataloss will happen. In order to find out I have to use <DeployToScript>True</DeployToScript>
, then load the script up to see:
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
Is there a way to get vsdbcmd to display this info when deploying direct to the DB without having to generate the sql first?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
没有办法做到这一点,这是一个错误(或缺少功能)。请参阅汤姆对我的问题的评论。
There is no way to do this, it's a bug (or missing feature). See Tom's comment to my question.
对我来说,我需要在部署 SQL 之前清空数据库
For me I was needed to empty my DB before deploying SQL