About a month ago I posed a question here on my blog SQL Server devs–what source control system do you use, if any? (answer and maybe win free stuff) in which I asked SQL Server developers to answer the following questions:
- Are you putting your SQL Server code into a source control system?
- If so, what source control server software (e.g. TFS, Git, SVN, Mercurial, SourceSafe, Perforce) are you using?
- What source control client software are you using (e.g. TFS Team Explorer, Tortoise, Red Gate SQL Source Control, Red Gate SQL Connect, Git Bash, etc…)?
- Why did you make those particular software choices?
- Any interesting anecdotes to share in regard to your use of source control and SQL Server?
I had some really great responses (I highly recommend going and reading them). I promised that the five best, most thought-provoking, responses (as determined by me) would win one of five pairs of licenses for Red Gate SQL Source Control and Red Gate SQL Connect; here are the five that I chose (note that if you responded but did not leave a means of getting in touch then you weren’t considered for one of the prizes – sorry):
In general, I don't think the management overhead and licensing cost associated with TFS is worthwhile if all you're doing is using source control. To get value from TFS, at a minimum you need to be using team build, and possibly other stuff as well, such as the sharepoint integration.
If that's all you need, then svn with Tortoise would be my first choice. If you want to add build automation later, you can do this with cruisecontrol (is it still called that?), JetBrains, etc.
For a long time I thought that Redgate's claims about "bridging the SSMS-VS divide" were a load of hot air, since in my experience anyone who knew what they were doing was using Visual Studio, in particular SSDT and its predecessors.
However, on a recent client I was putting in source control for the first time, and I discovered that the "divide" really does exist. That client has ended up using svn with Redgate SQL Source Control, with no build automation, but with scope to add it in the future.
I think putting the DB under source control is a great idea. I have issues with the earlier versions of SQL Source Control in that it provides little help in versioning the DB. I think the latest version merges SQL Compare and SQL Source Control together. Which is how it should have been all along. Sure I have the DB scripts in SVN, but I can't automate DB builds and changes without more tools. Frankly I'm surprised databases don't have some sort of versioning built into them.
Source control has been immensely useful and saved me from a lot of rework on more than one occasion. I have learned that you have to be extremely careful checking in data. Our system is internal only so during the system production run once a week, if there is a problem that I can fix easily(for example, a control table points to a file in the wrong environment), I'll do it directly in production so the run can continue as soon as possible since we have a specified time window. We do full test runs to minimize this but it has come up once or twice. We use Red-Gate source control to "push" from the test environment to the production environment. There have been a couple of occasions where the test environment with the wrong setting was pushed back over the production environment because the change was made only in production. Gotta keep an eye on that.
Goodness is it manual. And can be extremely painful at times. Not only are we running thin, we are constrained on the tools we can get ($$ must mean free). Certainly no excuse, and a great opportunity to improve my skills by learning new things. But... Getting buy in a on a proven process or methodology is hard, takes time, and diverts us from development. If SQL Source Control is easy to use and proven oh boy could you get some serious fans around here! Seriously though, as the "accidental dba" of this shop any new ideas / easy to implement tools can make a world of difference in productivity and most importantly accuracy. Manual = bad. :)
John Hennesey (who left his email address)
The one thing I would love to know more about is the unique challenges of working with databases as source code - you can store scripts, but are they written as deployment scripts with all the logic about how to apply them to an existing DB? Where is that baseline DB? Where's the data? How does a team share the data and the code? It's a real challenge.
Congratulations to the five of you. Red Gate will be in touch with you soon about your free licenses.
Thank you to all those that responded. And again, go and check out all the responses – those above are only small proportion from what is a very interesting comment thread.