Schema Compare allows you to update a database to a particular revision from the version control repository.
You might encounter a scenario where you need to revert a database to an earlier version.
For instance, a stored procedure is created and committed to the source control repository. Later, additional changes are made and committed as well. If issues arise after the latest commit, you will be forced to revert the changes and restore the earlier version from source control.
This topic outlines the steps required to restore a specific version of any database object.
To update your database schema to a particular version:
1. On the File menu, click New Schema Comparison.
2. In the New Schema Comparison wizard, specify Source and Target connections.
3. Under Source, specify Source Control as Type and indicate the name of your Repository.
See also: How to configure a link to your repository.
4. Specify the Revision you want to update the database to. Note that the Latest (Head) Revision is specified by default.
5. To specify a different revision, choose <…Select a specified revision…> from the drop-down list. In the Revision history window that opens, you can see the list of the source-control revisions of your database.
6. Select a required revision, and you will see the code changes introduced by the commit in the Window below. You can also read a commit message and identify the operation that has taken place in this particular revision.
7. Configure the rest of the settings and start the comparison process.
8. Click to synchronize the objects to the target database. Configure and run the synchronization.
9. The database is updated to the revision you selected.
Note
If you update your database to a particular revision, the current database schema will be overwritten by the changes introduced with the selected version.