Get Change Script

When an apply change goes wrong you get the option to edit the script, is there any way to get this script instead of applying the changes if there isn't an error.

The reason is we have a copy of our live database that I'm trying to bring up to date with the dev version.
It's massively out of date and has had duplicate changes made to it (don't ask :angry: ) and contains many migration scripts and commits in source control. I'm stepping through the commits and applying them which works. However I'm going to have to repeat this process again later with the real live data and if I could just save the SQL scripts out to run manually I could get the database up to date a lot faster.

I know about using SQL compare to generate a change script using source control as the source, however this won't run the migration scripts. The migration scripts don't contain the meta data changes that tell source control they've been applied, which the edit scripts option of a failed script does on source control.

Best Answer

  • BobBob Posts: 2 New member
    Accepted Answer
    My Bad, it wasn't obvious till I looked at the script generated but SQL Compare does actually generate the related migration script code. So the answer is to use SQL Compare against the SQL source control source
Sign In or Register to comment.