SQL Source Control 3

Getting a specific version

You can update your database to a specific version in the History dialog box using SQL Compare or SQL Data Compare.

When you do this, the current database schema (and any source-controlled data) is overwritten with the version you selected.

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:

  1. On the History dialog box, select the version you want to get.
  2. 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.
  3. A SQL Compare or Data Compare project launches with the version you selected set as the source, and the database as the target:

  4. 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:

  1. Check out the latest version to a new folder.
  2. Right-click the folder, and from the TortoiseSVN menu, select Show log.
    The Log Messages dialog box is displayed.
  3. Select the revision you want to get, right-click, and click Revert to this revision.
  4. A confirmation dialog box is displayed. Click Yes.
    The folder of scripts is updated to the revision you selected.
  5. 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:

  1. 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.
  2. Under Version, in Type select Changeset.
  3. Type the changeset number, or click the browse button to display the Find Changesets dialog box, and select the changeset you want.
  4. Click Get.
    The local scripts folder has been updated to the changeset you selected.
  5. 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.


Didn't find what you were looking for?