In this article, I will share with you on how to version control your SQL Server Stored Procedure using TFS in Visual Studio 2012.
Now we can follow the steps below to add Stored Procedures to TFS for version control.
- Launch VS 2012. Open an existing SQL Server Database Project or create a new one.
- Then we can import your database in Solution Explorer. Right-click on the project, and click Import -> Database…
- We will be prompted with Import Database dialog below.
- Click New Connection… and specify the Server and database name in Connection Properties window. And click OK
- After finishing importing the database objects to the VS project, we can now add it to TFS for source control.
First, make sure Visual Studio Team Foundation Server is the current source control provider at menu Tools->Options->Source Control.Right-click the solution file in Solution Explorer and click Add Solution to Source Control…Select the Team Foundation Server and Team Project to put your database project.
- Specify the location to store the project.
- Now you can manage the versions of the stored procedures in TFS.