I'm using a blue-green deployment strategy with expand contract database pattern. To achieve that on my database deploy schema I've setted the property BlockOnPossibleDataLoss=true because on Expand phase I can modify my database without any break change with the old version.
I had a column that is not necessary anymore so I followed those steps:
- I've changed this column to allow null values
- Then my new records don't fill this column anymore
- I ran a script that setted null for this column to all table records
Now I need to delete this column, but even with all records with NULL value for this column I can't because I got this error:
Rows were detected. The schema update is terminating because data loss might occur.'
How can I delete this column even using BlockOnPossibleDataLoss=true?
tmp_YourTable
(Not a temporary table)EXEC sp_rename 'tmp_YourTable', 'YourTable';