I had been getting the error when publishing a SQL project.
I was testing on a database made from the production schema with some test data.
When I looked at the error from the Data Tools Operations tab in Visual Studio, I saw this:
/*
The column [dbo].[MyTableName].[UnexpectedColumnName] is being dropped, data loss could occur.
*/
IF EXISTS (select top 1 1 from [dbo].[MyTableName])
RAISERROR (N'Rows were detected. The schema update is terminating because data loss might occur.', 16, 127) WITH NOWAIT
GO
However, the UnexpectedColumnName
column name has not been in that table for quite a long time.
The question was how why that SQL was being generated.