If you encounter any issues or errors during the deployment, you can create a rollback script to reverse a deployment or undo changes made to a SQL database.
Note
It is crucial to create an undo or rollback script before deploying the database changes.
To create a rollback script in Schema Compare, you need to compare the same settings as when you сompare databases to get a deployment one. The only difference is that you switch the source and target databases on the Source and Target page of the Change Schema Comparison Properties wizard. Then, you need to repeat the comparison to generate a script.
Before deploying object changes, it is highly recommended to:
1. On the Comparison menu, select Edit comparison. Alternatively, on the Schema Comparison toolbar, click Edit comparison.
2. On the Source and Target page of the Change Schema Comparison Properties wizard, swap Source and Target to change the direction of synchronization.
Note
Keep in mind that this method will reset any manual mapping that was previously set. Thus, you will have to set custom schema and object mapping manually.
3. Once done, click Compare.
4. Review the generated .scomp document.
5. Click Synchronize objects to the target database to open the Schema Synchronization Wizard.
6. In the Schema Synchronization Wizard, choose the same options as you used to generate the deployment script.
7. Click Synchronize.
If you have chosen Open the synchronization script in the internal editor, the generated script will open in a SQL editor:
For more information on how to start a comparison project, refer to Select data sources for comparison.