Source Control for Stored Procedure in SQL Server 2008
This article explains how to source control stored procedures and other objects in SQL Server Management Studio 2008. We use SourceAnywhere Standalone for example, which is a SQL-based source code control software designed to be a replacement of Microsoft Visual SourceSafe. Other MSSCCI compatible source code control solutions work in a similar way.
The detailed steps are as follows:
1) Open SQL Server Management Studio.
2) Initiate source control for SSMS. Please click menu Tools | Options | Source Control. In the dropdown list, choose Dynamsoft SourceAnywhere Standalone 2.3 as the current source control plug-in. |
3) If we have an existing application solution, we can click menu File | Open | Project/Solution to open it in Solution Explorer. And then we can add the solution/project into version control. Right-click on the solution/project and then choose Add Solution to Source Control in the content menu. |
You can also start a solution from the ground. Click menu File | New | Project and choose a proper template. Don’t forget to check the Add to Source Control option. |
4) Put the correct server info and credentials.
5) In the project tree, choose a location to put the solution/project.
At the end of the step, the solution/project is under version control.
6) Now it’s time to add a new or existing stored procedure into the solution.
To create a new stored procedure, in Solution Explorer, we can right click on the project name and hit the Add | New Item menu. |
Under SQL Server Query, navigate to the Stored Procedure category and choose a template.
Adding an existing store procedure is easier. Instead of selecting New Item in the Add popup menu, we choose Existing Item.
7) Finally, we can perform the basic source code control operations in Solution Explorer, such as Check Out and Check In, by right clicking on an object. All the objects checked out to be edited can be found in the Pending Checkins window.
If you want to try SourceAnywhere Standalone, please install its Windows GUI Clienton the machine where SQL Server Management Studio resides. The can be integrated with all MSSCCI compatible IDEs, such as Visual Studio 6.0, 2005/2008/2010. Downloaded link: https://www.dynamsoft.com/Secure/RegisterClientInfo.aspx?productName=SAWstandalone&from=FromDownload