Advanced Upgrade

Upgrades are pretty straightforward but there are some scenarios where you may want to tinker with the upgrade script or execute actions before or after the upgrade.

If you want to see the exact T-SQL script that DAC would execute, you can get the script directly or acquire it from the upgrade wizard as I’ve already shown in the upgrade video.

Additionally, if you want to have your own custom scripting occur before or after the upgrade the upgrade workflow in Visual Studio and SQL Server Management Studio have support for pre and post deployment scripts. The scripts are run automatically by Visual Studio and optionally within SQL Server Management Studio:

Finally, if you want to just run your own upgrade script but really like the DAC versioning and change detection features, you could also run any arbitrary T-SQL script on a target database, delete the database registration, then re-register the database with a new version number and you are good to go!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: