How to Source Control SQL Server Stored Procedure using TFS in VS 2012?

In this article, I will share with you on how to version control your SQL Server Stored Procedure using TFS in Visual Studio 2012.

Dynamsoft Barcode Reader SDK
Ads Powered by Dynamsoft

Here I am using Dynamsoft TFS Hosting service. If you don’t have a TFS account yet, you can sign up online here with free trial.

Now we can follow the steps below to add Stored Procedures to TFS for version control.

  1. Launch VS 2012. Open an existing SQL Server Database Project or create a new one.New sql database project
  2. Then we can import your database in Solution Explorer.  Right-click on the project, and click Import -> Database…Import the database to the project
  3. We will be prompted with Import Database dialog below.Import Database dialog
  4. Click New Connection… and specify the Server and database name in Connection Properties window. And click OKConnection Properties
  5. 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.

    Connect to Dynamsoft TFS 

  6. Specify the location to store the project.Add to TFS
  7. Now you can manage the versions of the stored procedures in TFS.TFS Source Control Commands