Cannot Publish If Data Loss Might Occur

Answered Cannot Publish If Data Loss Might Occur

  • Wednesday, November 16, 2011 2:01 PM
     
     

    I am trying to publish a change in which I remove a column from a table. I am using a "Juneau" CTP3 database project. I have the option to "Block Incremental deployment if data loss might occur" unchecked in my project settings. I also verified that this option is unchecked in the advanced options of the publish dialog before publishing. When I attempt to publish, I get the error:

    SQL Execution error: .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.

    If I generate a script instead, the following lines are added to the script:

    IF EXISTS (select top 1 1 from [dbo].[Table]) RAISERROR ('Rows were detected. The schema update is terminating because data loss might occur.', 16, 127) WITH NOWAIT

    The same thing happens if I attempt to update using schema compare. Is this there another setting I need to update to allow this type of change?

All Replies

  • Tuesday, November 22, 2011 5:01 PM
    Owner
     
     Answered

    The project settings is used for Debugging scenarios where you'll probably want more lax rules than you'd use when publishing. 

     

    When you publish could you select the "Advanced..." button and verify "block on data loss" is unchecked?

    Schema compare has it's own settings - in the schema compare toolbar please select the "Options" button and verify "block on data loss" is unchecked.

    • Marked As Answer by CAJordan Tuesday, November 22, 2011 6:52 PM
    •