What are the challenges you face when working across database platforms? Take the survey

SQL Compare Macro

StevenSStevenS Posts: 1 New member
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:
  1. I run the Deploy Wizard in reverse and save the script.  This acts as my rollback script if I need to back out changes.
  2. I generate a comparison report so that if necessary, we can quickly see what has changed in the deployment
  3. I run the Deploy Wizard to deploy the changes, saving the script again but in the deployment direction.
These three steps take a bit of time and what I'd ideally like to do is once I've got the elements selected to deploy, click a single button and have all of those steps done automatically for me.  I've thought about creating a command line routine but that would not allow me to review specific elements to deploy.

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.



  • Options
    Eddie DEddie D Posts: 1,789 Rose Gold 5
    Hi StevenS,
    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 Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
Sign In or Register to comment.