Jonathan Allen

Keeping a track of database changes

Published Wednesday, July 14, 2010 4:30 PM

If you are anything like me you work as part of a small team managing databases, doing a bit of web development, handling calls for technical support, attending countless meetings and about a hundred other things. Its long been a constant concern of mine that there are changes being made to databases that I manage that will one day trip me up. Someone will add just one too many columns to a table, or even drop a table, and an application will stop working. When was the change made, who made it, why, was it tested before it was rolled into live? Unless you are blessed with clairvoyant powers or have a psychic friend, you would be best getting over to RedGate software.

The worries about this sort of thing are greatly eased now that RedGate have created SQL Source Control. It's source control for your database, that you access from right inside Management Studio. It uses either Team Foundation Server (TFS) or Subversion (SVN) for the document store and your whole team can now update their own copies of a database and then merge changes safe in the knowledge that they have the most up to date, working schema in their hands.

The process could only be simpler if RedGate sent someone around to do it for you:

  1. Create or select a folder where the SVN repository is going to be stored
  2. Use TortoiseSVN to create a repository
  3. Select your candidate database in SSMS Object Explorer
  4. Link SQL Source Control to the repository folder

Done!

Any changes you now make in SSMS now get collected by SSC and you then get the ability to commit the changes to the repository at your convenience. If someone else in your team has made changes too then you can get the latest version from the repository and see if there are any conflicts and resolve them. The differences between different versions is also shown within SSMS so that you can see exactly what was changed.

Given that you make a series of changes to a dev database and commit these changes to the SSC repository and have run your tests to ensure its a workable set of updates you can then easily use SQL Compare to execute the scripts against your live server to move the changes into production.

RedGate have some videos of SSC in use and a few help files on their site here http://www.red-gate.com/products/sql_source_control/evaluation_center/index.htm and if you like what you see, you can grab a 28 day fully functional trial from the same place. RedGate's SQL Toolbelt is a suite of applications for the busy DBA and they have added SSC to that suite, this means existing customers get it for free, for anyone new to SQL Toolbelt, well, you are getting even better value, at last count there are 14 applications included. I would heartily recommend it.

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

What do you think?

(required) 
(optional)
(required) 

About fatherjack

DBA since 1999 working for not-for-profit company. http://twitter.com/fatherjack,



















<July 2010>
SuMoTuWeThFrSa
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567
Minesweeper in T-SQL
 Whatever happened to the idea that programming in TSQL can be fun? A Simple-Talk reader contributes an... Read more...

SQL Source Control: The Development Story, Part II
 When creating SQL Source Control, the team had to make decisions as to which source control systems the... Read more...

Raw Materials: Healthy Caution or Something Else?
 Derek slips a cog. Read more...

The DIS-Information Principle, Part II
 Database design simply involves populating a schema with tables that model sets of entities and... Read more...

OCS Disaster Recovery, Part 2
 There are several possible disasters which might happen to your Office Communications Server... Read more...