Using SQL Server Management Studio with Subversion

The Agent SVN plug-in allows you to seamlessly integrate Microsoft SSMS with Subversion. The plug-in has been tested with both SSMS 2008 and SSMS 2014 versions and it should also work with any versions in between.

IMPORTANT: The Agent SVN plug-in will also work with SSMS 2017 however it will require some tweaking of the SSMS 2017 configuration as described here.

Features of the plug-in include:

  • Easy to install, easy to configure, easy to use
  • Add solutions, projects and files to Subversion, all from within the IDE
  • Check out, check in, get latest version all without leaving the IDE
  • Revert file changes from within the IDE
  • Provides the option of automatic file locking on check out and unlocking on check in
  • View file differences, file status and file history from within the IDE
  • The power of Subversion with the feel of Visual Source Safe
  • Can use an external difference tool to view file differences
SSMS
D:\Projects\Keys & WebSite\WebSite\Zeus\agent\ide\com\ssms-2017.html

Tutorial

Described below are the steps required to get Agent SVN to work with Microsoft SQL Server Management Studio 2008 and Subversion.

To use Agent SVN with Microsoft SQL Server Management Studio 2014 just follow the same steps using the exact same menus commands and dialog configurations as described.

As an introductory tutorial, it is recommended you follow the steps as described.


Step 1: Agent SVN Provider Setup

From within the Microsoft SQL Server Management Studio IDE use the Tools, Options menu to bring up the Options dialog and in the Source Control section select Agent SVN as the active provider as shown below:

SVN Repository Details


Step 2: Configure Agent SVN

Bring up the Agent SVN configuration as shown below:

SVN Repository Details


For this initial testing use the Folder entry field to define the location of a local Subversion repository and select the Local File protocol as shown below:

SVN Repository Details

NOTE: It is highly recommended you start with this minimal configuration since this is by far the simplest Subversion configuration model.

This will give you an opportunity to become familiar with how the plug-in works and at a later point it will be easy to reconfigure Agent SVN to another repository location using a different protocol.


Step 3: Create a Test SQL Project

To see how Agent SVN works we need something to play with so the next step is to create a simple test project.

From within Microsoft SQL Server Management Studio IDE create a new My Scripts project as shown below:

SVN Repository Details


Create a few SQL Query files in the project folder and the end result should be a project folder that looks something like this:

SVN Repository Details


From within the Microsoft SQL Server Management Studio IDE, add these SQL files to the project using the Solution Explorer and the end result should be a project that looks like this:

SVN Repository Details


Step 4: Add Solution to Source Control

At this point, we have a new project and will now use Agent SVN to import the project into the Subversion repository (as was defined in step 2).

NOTE: Agent SVN can also handle the case where the project already exists in the Subversion repository but for that case the project will need to be bound to the repository.

Use the menu shown below to import the project:

SVN Repository Details


Use the repository browser to confirm the project files are now inside the source control repository as shown below:

SVN Repository Details


Step 5: Using the Source Control

With the project now fully configured, you can now use the check out, check in, revert, file compare commands (or any of the other source control commands) to manage your SQL file.

SVN Repository Details


Information: Project/Solution Binding Error

On occasions, when opening a solution file Microsoft SQL Server Management Studio might complain that a project "is not bound to source control, but the solution contains source control binding information" and when this happens the following message will be displayed:

SVN Repository Details

When this happens select the circled option and MS-SCCI binding details from the the SSMS solution file will be used to fill in the missing details.

Why does this happen? This is usually the result of having a project in the solution that doesn't contain any files as shown below:

SVN Repository Details

Because the project is effectively empty, SSMS removes the MS-SCCI binding details from that project, but sometime later when the solution file is re-opened SSMS then complains the MS-SCCI binding details are missing from that project.

To fix this issue just make sure the project is not empty as shown below:

SVN Repository Details


Latest Version: Agent SVN 2.76
Released: 30th January 2024