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:
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.
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:
Bring up the Agent SVN configuration as shown below:
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:
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.
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:
Create a few SQL Query files in the project folder and the end result should be a project folder that looks something like this:
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:
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:
Use the repository browser to confirm the project files are now inside the source control repository as shown below:
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.
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:
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:
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: