In order to create a rollback script in dbForge Data Compare for SQL Server, you will need to perform the comparison with the same settings as when comparing databases to get a deployment one. The only difference is to change the synchronization direction and finally generate the script. See how to do this step-by-step below:
1. Having performed the comparison, right-click the generated .dcomp file.
2. Click Change Synchronization Direction.
3. You will see that the synchronization arrow now turns red and faces the opposite direction.
4. Click the red arrow.
5. In the Data Synchronization Wizard that opens, choose the most appropriate option.
6. Click Synchronize.
If you have chosen Open the synchronization script in the internal editor, the generated script will open as a separate tab in dbForge Data Compare for SQL Server:
You can also Save the script to a file on your computer.
Another way to create a rollback script is to swap Source and Target settings at the beginning of the comparison:
1. By swapping Source and Target you will simply change the direction of the comparison and synchronization.
Note
It is important to keep in mind that this method will reset any manual mapping that was previously set. Thus, you will have to manually specify the same mapping as before.
2. Once done, click Compare.
3. Review the generated .dcomp file.
4. Click the green arrow to invoke the Data Synchronization Wizard:
5. In the Data Synchronization Wizard that opens, choose the same options as you used to generate the deployment script.
6. Click Synchronize.
If you have chosen Open the synchronization script in the internal editor, the generated script will open as a separate tab in dbForge Data Compare for SQL Server:
You can also Save the script to a file on your computer.