How can we help you today? How can we help you today?

Data Loss Check in Script

I'm using the SDK to generate schema and data compare scripts.

The current system we use is from visual studio. When something occurs that will cause data loss (like dropping a column), the script will contain something like the following:
IF EXISTS (select top 1 1 from [MyTable].[MyColumn])
RAISERROR (N'Rows were detected. The schema update is terminating because data loss might occur.', 16, 127) WITH NOWAIT

From what I can tell RedGate does not provide an option to do something like this. Am I correct?

RedGate will instead generate a 'high' warning it would appear. Just want to make sure I am not missing an option or something...
medi_pv
0

Comments

1 comment

  • Sergio R
    Hi,

    You are correct, SQL Compare will generate a warning but will not introduce a guard clause.

    SQL Source Control another of our tools, enables user to create migration scripts to deal with data loss situations.

    Thank you,
    Sergio R
    0

Add comment

Please sign in to leave a comment.