How to handle SQL system generated names
Here is the scenario I have to solve. I'm trying to create a rollback script using SQL Compare that can be applied generically to any database on a specified product version. The tool works great to generate the original script. But my database used to model the script has SQL system names on DEFAULT constraints. So if my rollback script has to drop a constraint on rollback, it embeds the contraint by name (i.e. DF__Foo__IsDeleted__1B220F1A). Trying to execute this script on any other database obviously fails. Is it possible to do what I need using the tool and without the need to made manual modifications to the generated script?
0 · Share on Twitter