3

I guess this is an old issue, but does anyone know if it is fixed or addressed by Microsoft.

I have a database project in Visual Studio (.sql) and I want to drop a column when publishing it. The error is:

RAISERROR (N'Rows were detected. The schema update is terminating because data loss might occur.', 16, 127).

The target database does have rows in that table, but the column in question only has NULL values. So it should work, I think. (I know unchecking "Block on incremental deployment if data loss might occur" is a work-around, but I don't want to turn it off for all tables and columns.)

Thanks for any help.

user736570
  • 469
  • 4
  • 15
  • When I have run into this I created a pre-deployment script to drop the column off it exist to work around this issue. – James McShane Oct 16 '21 at 06:13
  • Thanks @JamesMcShane, but it did not help for me, I stilll get "data loss might occur". I read somewhere that the schema change analysis is done before running the pre-deployment script. So dropping the column in that script is "too late". – user736570 Oct 16 '21 at 07:13

0 Answers0