Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

What do you use for Database Source Control?

22 Feb 2012 3  
Article about Red Gate's SQL Source Control

This article is in the Product Showcase section for our sponsors at CodeProject. These articles are intended to provide you with information on products and services that we consider useful and of value to developers.

By Enrique Lima (reproduced with permission from http://geekswithblogs.net/enriquelima/archive/2011/05/02/what-do-you-use-for-database-source-control.aspx)

I have found myself using tools from Red Gate Software more and more. In my experience they have proven to be both effective and to the point.

Today I’m talking about the SSMS plug-in SQL Source Control. It’s simple to use and makes adding a database to Change Control easy, which really is the goal. Don’t get me wrong, Visual Studio is a great tool, but it’s a developer’s tool. As a DBA or Database Developer (referring to an individual who codes T-SQL) I want to launch SQL Server Management Studio and be able to control my environment from there. This is where SQL Source Control shines as it integrates into SSMS. It allows me to enrol a database into source control and control my resources.

Here is the step-by-step process I followed:

First you will come to the Welcome Screen and the status of the Database being enrolled.

330179/ELimage1new.png

Begin by linking a database to source control. I am connecting mine to TFS, but it can connect to other environments as well. Also important to note, SQL Source Control works really well with new and existing databases.

In my scenario I used AdventureWorksLT.

The first thing I did was create a location within my branching structure in TFS to store the DB Source.

330179/elimage2new.png

There are two operating modes, dedicated or shared. Again this will depend on the approach your developers take - the dedicated method is where everyone has a copy of the database, the shared model is where there’s a central database everyone works from.

Once the Link process has started, you will see an object enrolment process. When it completes you will see the DB icon turn green as a visual indicator stating the DB is now under source control.

330179/elimage3new.png

If you right-click on the database and select Commit Changes, you will get a list of the items that will be added. As you click on the items in the list there will be a window displaying the changes in T-SQL.

330179/elimage4b.png

Click Commit.

330179/ELimage5.png

Once the check-in completes you will notice the blue dots are no longer on the folders, which means all items are synchronized and current.

As I mentioned above, it’s a very straight forward process and a great tool for Change Management to put in effect in your DB environment.

Why not put your database under source control now? It will only take 5 minutes and it could be the best 5 minutes you spend this year. Find more information and a free trial of SQL Source Control here.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here