SQL Source Control - 3.0

SQL Source Control

Linking a database to source control - SQL Source Control

Linking is the setup step for SQL Source Control. You need to link before you can commit the database objects.

Linking associates a database with a location in source control, allowing SQL Source Control to monitor changes, and manage migration scripts.

When you link, you tell SQL Source Control if a database is shared, so it can alert you to any conflicts or issues with shared working

For more information, see Database development models

When linking a database, you have two options:

  • Link the database to source control

    This is used to source control a database for the first time; to associate your version of a database with one that is already source controlled; or to get a new database from source control.

  • Use the evaluation repository

    This creates a local Subversion repository on your computer, so you can evaluate SQL Source Control even if you do not have source control set up.

    For more information, see Using the evaluation repository

To link a database to source control:

  1. In SQL Source Control, on the Setup tab, ensure a database is selected, and click Link to source control.

    The Link Database to Source Control dialog box is displayed:

  2. On the left hand side, select your source control system; either Subversion (SVN), Team Foundation Server (TFS), Vault, More (for custom setup, including Perforce, Git, and Mercurial) or Just Evaluating.
  3. Provide details for the source control location you want to link the database to.

    For Subversion:

    Type or paste the URL for your Subversion repository.Type or browse to the location of the folder you are linking to.

    For Team Foundation Server:

    Type or paste the URL of your Team Foundation Server and the port number to connect to that server; type or browse to the location of the Team Project and solution you want to associate with the database.

    For Vault

    Type or paste the URL of your Vault server and your repository name; Type or browse to the location of your database folder.

    For other source control systems

    Type or browse to the location of your working folder, then select the config file you are using.

    For more information, see Working with config files

    If you are creating a new link you can create a new folder by clicking Browse, choosing a location, and clicking Create Folder

  4. Tell SQL Source Control if the database is shared.

    If you are linking to a database that will be used by multiple developers, ensure the This is a shared database radio button is selected.

    For more information, see Database development models

  5. Specify a location for your migration scripts repository.

    Migration scripts are customizable change scripts, re-used in deployment. They are stored in source control in a separate folder to your database schema.

    For information on where to create a migration scripts folder, see: Working with Migrations

  6. Click Link

    The database is linked to source control.

    The database icon in the Object Explorer changes to show that the database is linked:

Note that linking only associates the database with a location in source control.

If you are creating a new link, the database objects are not yet source controlled.

If you are linking to an existing version, your database has not yet been updated to that version.

To commit the objects or get the latest version, next go to either the Commit Changes tab or the Get Latest tab.

See also

Source controlling data

Working with config files

Was this article helpful?

Search support
Forums

SQL Source Control

all SQL products

all products