Getting a specific version
Published 16 July 2015
You can update your database to a specific version using SQL Compare or SQL Data Compare.
- If you want to update the schema, you need SQL Compare Pro 8.5 or later.
- If you want to update the data, you need SQL Data Compare 10 or later.
Getting a specific version from the History dialog box
When you get a version form the History dialog box, SQL Compare or SQL Data Compare is used to update the target database.
To get a specific version:
In the Object Explorer, right-click the database or object and click View history:
The History dialog box opens:
- Select the version you want to get.
- If you want to update the schema, click Update to this version with SQL Compare.
If you want to update the data, click Update to this version with SQL Data Compare. A SQL Compare or Data Compare project launches with the version you selected as the source, and the database as the target:
- To update the database, run the comparison, make sure all objects you want to update are selected, and run the deployment wizard.
For more information about comparing databases with SQL Compare, see Worked example - comparing and deploying two databases in the SQL Compare documentation.
Getting a specific version manually
You can get a specific version using your source control system and SQL Compare.
Example: getting a specific revision with TortoiseSVN
This example creates a local copy of the revision and deploys the database using SQL Compare:
- Check out the latest version to a new folder.
- Right-click the folder, and from the TortoiseSVN menu, select Show log.
The Log Messages dialog box is displayed. - Select the revision you want to get, right-click, and click Revert to this revision.
- A confirmation dialog box is displayed. Click Yes.
The folder of scripts is updated to the revision you selected. - Using SQL Compare, set the scripts folder as the source for a comparison, and the database as the target, then compare and deploy.
The database is updated to the revision you selected.
Example: getting a specific changeset with TFS
This example updates the TFS local copy to a specific changeset, and deploys the database using SQL Compare:
- In Visual Studio, in the Source Control Explorer tab, select the database, right-click, and click Get Specific Version.
The Get dialog box is displayed. - Under Version, in Type select Changeset.
- Type the changeset number, or click the browse button to display the Find Changesets dialog box, and select the changeset you want.
- Click Get.
The local scripts folder has been updated to the changeset you selected. - Using SQL Compare, set the local scripts folder as the source for a comparison, and the database as the target, then compare and deploy.
The database is updated to the revision you selected.