Article posted by Vishvvas
on 9/3/2012 | Views: 3361 | Category: Sql Server
| Level: Advance | Points: 250
This article explores the feature (of SQL server tools) of adding the projects into source control repository like TFS.
Introduction and background
TFS is one stop solution for source code repository, issue
tracker, agile and CMMI implementation. Source control options for DB and
database objects has been a challenge for quite some time now though there are
many options available.
As TFS is mostly the choice for .NET projects, it becomes
obvious that for DB too TFS needs to be used so as to have all source code in
one environment and there is consistent way of making changes to such source
VS 2010 offers a type of project called “Database project”
- Data Generation Plans
- Schema Comparisons
- Schema Objects
This kind of project can be put into source control as other
project like website, class library etc. We would see this in different
Another option available is to create projects in SSMS (SQL
Server Management Studio) and add to source control. We would discuss this
option in details in this article.
This write-up includes the TFS plugin for SSMS (SQL Server
Management Studio) and its consequent usage as addition into real project in
NASCO environment would create a lot of issues, the further part is not explored.
Let’s follow 2 step action where firstly we would set the
plugin and configuration settings and then create a project in SSMS and see the
simple menu to put into the TFS repository.
Setting the Plugin and configuration
The plugin available for SSMS is called as “Team Foundation
Server MSSCCI Provider” which is available at http://www.microsoft.com/en-us/download/details.aspx?id=12128.
This needs to downloaded and installed on the developer machine. Once it is
downloaded and installed, it would need to be configured.
Once the plugin is selected as shown above then the environment
and Plug in Settings sub option needs to be provided under “Source Control”.
Clicking on “Environment” sub option for “Source Control”
pops up following screen. Different options like “Visual SourceSafe”, “Independent
Vendor” and “Custom” are available. Pl. choose “Independent Vendor” for our
Choosing the TFS in “Plugin Settings” and enter login id as
Setting Up the project
We are done with setting up the source control for SSMS projects. Next step is to create such project and put such project in chosen repository i.e. TFS for this exercise.
The source control operations can be seen once we create project and add such project to source control. Create a SQL server scripts project executing the following steps.
Different templates like “SQL Server Scripts”, “Analysis
Service Scripts”, “SQL Server Compact Edition Scripts” are available and we
would explore “SQL Server Scripts”.
Such project can be added to source control as shown below.
Click “Add Solution to Source Control” and following prompt
appears where in the location of TFS server and TFS Project needs to be
Once the TFS server details are provided, the credentials
for TFS needs to be supplied in following prompt.
Once the authentication is accomplished, the details of
projects on TFS server are seen as following and the target location is chosen
the SSMS projects is added into TFS.
Yes, we are
done with addition of SSMS project into TFS and we would be able to perform the
operations like commit, shelve etc.
The SQL projects in SSMS can be configured to reside in
source control repository. For TFS the, the plug in tool can be employed for
SSMS which helps to connect to TFS and store, change the source code for the
same. Through SSMS the database project which is created through visual studio
can’t be opened and hence as of now with professional edition, one can use SQL
Server Script through SSMS.This looks like better option than database project
if only the source control mechanism is considered.
Red Gate’s offering SQL source control actually is a connector for different repositories like TFS, SVN.
This can really be helpful for versioning of scripts when database is in production. Such versions can be synergized with the front end code version or it can carry its own version. This would definitely solve the challenges
in maintaining the different scripts and versioning thereof.Red Gate’s offering SQL source control actually is a
connector for different repositories like TFS, SVN.
If you like this article, subscribe to our RSS Feed. You can also subscribe via email to our Interview Questions, Codes and Forums section.
Found interesting? Add this to: