SQL Source Control 7

Working with branches

There are several different ways to switch between existing branches in SQL Source Control.

SQL Clone

This method only works with Git using the dedicated development model.

SQL Clone can be used to create full copies of your database for each piece of work during development, and switch between them automatically when you change branch in git. This allows you to make changes to your database on one branch, and store those changes when you need to work on another branch. When you return to the original branch all your database changes including data will be preserved.

See the SQL Clone documentation for more details.

Get latest

This method only works with Git, Working folder or Custom version control systems.

In your version control system, check out a revision on the desired branch. In SQL Source Control, use the Get latest tab to retrieve all changes for that revision.

Unlink and relink the database

With this method, you work on one database in SQL Server Management Studio, and link it to the branch in your source control system.

Once you've created the branch, un-link the database in SQL Source Control, then link the database again. When you link, specify the location of the branch in source control.

Create a new database for the branch

This method only works if you're using the dedicated development model.

With this method, you create the branch in your source control system, then create a new database to link with it.

To do this:

  1. In SQL Server Management Studio, create a new empty database.
  2. In SQL Source Control, link the database to source control, specifying the location of the branch in source control
  3. On the Get Latest tab, update the database with the latest version from source control.

Didn't find what you were looking for?