SQL Compare Macro
StevenS
Posts: 1 New member
in SQL Compare
I'm wondering if there is a way to create a macro or some other automation method in SQL Compare. We do all of our coding / testing on our test SQL databases and when I'm ready to promote those changes to production I use SQL Compare. Because certain elements may not be ready for deployment I select which table/view/procedure changes need to be pushed. At that point for rollback and documentation purposes I do the following:
Does anyone have a better way of handling creating rollback routines when deploying changes? I always want to make sure I have the script to reverse out any changes I make. Just looking to avoid manual user interface steps if I can.
- I run the Deploy Wizard in reverse and save the script. This acts as my rollback script if I need to back out changes.
- I generate a comparison report so that if necessary, we can quickly see what has changed in the deployment
- I run the Deploy Wizard to deploy the changes, saving the script again but in the deployment direction.
Does anyone have a better way of handling creating rollback routines when deploying changes? I always want to make sure I have the script to reverse out any changes I make. Just looking to avoid manual user interface steps if I can.
Tagged:
Answers
Thank you for your forum post.
There is no macro available that will perform the steps described in your post.
By default, the deployment process uses to transactions to deploy the changes, if an error occurs the changes are rolled back. Therefore I am unsure of the purpose of your first step. Also it is good practice to backup the target database or generate a SQL Compare snapshot of the target before running the deployment process in case you do need to revert the changes after a successful deployment
Using the command line, you can automate the comparison, generate both a comparison report and a copy of the deployment script, and deploy the changes to the target.
Many Thanks
Eddie
Senior Product Support Engineer
Redgate Software Ltd
Email: support@red-gate.com