vsdbcmd data loss may occur, but where?
Asked Answered
A

2

6

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

Asch answered 5/5, 2011 at 13:22 Comment(2)
I've raised a Connect feedback entry related to this: connect.microsoft.com/VisualStudio/feedback/details/678292/…Cribbing
Thanks Tom, I've just logged in and up-voted it on the connect website.Asch
A
0

There is no way to do this, it's a bug (or missing feature). See Tom's comment to my question.

Asch answered 24/1, 2012 at 16:48 Comment(0)
F
-1

For me I was needed to empty my DB before deploying SQL

Fonzie answered 27/9, 2011 at 12:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.