Compare SQL version control versions

You can compare version control revisions with other data sources, such as a database, snapshot, scripts folder, or another version control revision.

The New Schema Comparison wizard enables you to:

  • Add a new SQL version control version as the source or target.
  • Select an existing version control version.
  • Connect to a version control system, including Git (GitHub, GitLab, Bitbucket, and Azure DevOps), TFVC, Subversion, SourceGear Vault, Perforce, and Mercurial.
  • Deploy changes from or to the version control repository.

Warning

You cannot compare a working folder with other data sources. Instead, use a scripts folder.

Compare version control revisions as the source

1. Open the New Schema Comparison wizard in one of these ways:

  • In the top menu, select Comparison > New Schema Comparison.
  • On the Start Page, select Database Sync > New Schema Comparison.

2. Under Source:

2.1. In Type, select Source Control.

2.2. In Repository, select one of the following options:

  • Select the previously added version control repository.

  • Click New to create a repository and add it to schema comparison.

  • Click the ellipsis (…) and edit the repository settings.

2.3. In Revision, select the repository revision:

2.4. Optional: Select Use target database properties to ignore database property differences and preserve target settings.

3. Under Target, select the data source to compare with the version control revision, then configure the data source settings.

4. Optional: On the Options page, configure the comparison settings.

5. For Database, Backup, or Snapshot:

5.1. On the Schema Mapping page, map schemas.

5.2. On the Table Mapping page, map tables and columns.

Note

The database objects with the same names are mapped automatically.

6. Click Compare.

The comparison results appear in the Schema Comparison document.

By default, all objects are selected for synchronization. To exclude any objects from synchronization, clear the checkboxes for the corresponding objects.

7. At the top of the document, click Synchronize objects to the target database to open the Schema Synchronization Wizard.

8. Select an output option to generate a synchronization script, and optionally configure the synchronization settings.

9. Click Synchronize.

Compare version control revisions as the target

1. Open the New Schema Comparison wizard in one of these ways:

  • In the top menu, select Comparison > New Schema Comparison.
  • On the Start Page, select Database Sync > New Schema Comparison.

2. Under Source, select the data source to compare with the version control revision, then configure the data source settings.

3. Under Target:

3.1. In Type, select Source Control.

3.2. In Repository, select one of the following options:

  • Select the previously added version control repository.

  • Click New to create a repository and add it to schema comparison.

  • Click the ellipsis (…) and edit the repository settings.

3.3. In Revision, select the repository revision.

4. Optional: On the Options page, configure the comparison settings.

5. For Database, Backup, or Snapshot:

5.1. On the Schema Mapping page, map schemas.

5.2. On the Table Mapping page, map tables and columns.

Note

The database objects with the same names are mapped automatically.

6. Click Compare.

The comparison results appear in the Schema Comparison document.

By default, all objects are selected for synchronization. To exclude any objects from synchronization, clear the checkboxes for the corresponding objects.

7. At the top of the document, click Synchronize objects to the target database to open the Schema Synchronization Wizard.

8. Select an output option to generate a synchronization script, and optionally configure the synchronization settings.

9. Click Synchronize.

Create a repository

1. In the New Schema Comparison wizard, click New.

2. In Source control system, select a version control system.

3. Configure the repository settings for the selected version control system:

  • Add a Git (GitHub, GitLab, Bitbucket, and Azure DevOps) repository
  • Add a TFVC repository
  • Add a Subversion repository
  • Add a SourceGear Vault repository
  • Add a Perforce repository
  • Add a Mercurial repository

4. Optional: Click Test to verify the repository settings.

5. Click OK to close the dialog.