Our build process is fairly clean with the help of Team Foundation Server. We can build and publish a website in 3 branches Dev/Qa/Prd. Outside some funniness with web.config (that could be helped by more .NET 4 usage) this works well.
But, on the DB side things are not so satisfying. I script out all updates and compile then into a single file. Then I send this file off to another guy who actually runs the scripts.
Problems
- AFAIK TFS has weak/poor/no integration with SQL server.
- I easily miss an update (scripting permissions…).
- I don’t enjoy making complex scripts to insert a column at a specific index/ordinal.
- Its easy to miss a trigger.
- Its not fun to script test data either.
- The process is disconnected from our normal build. (Joel tests 1 step build = fail)
I have used Contiuous Integration in the past. Though, I’m not sure how this could help us with SQL. So, how can I do to make the process more automated for SQL?
You can create a SQL project now in Visual Studio, which may have some of the functionality that you need. To be honest though, I’ve only created one so far just to play around with it because my current client is a Java shop.
Another option is Red Gate’s SQL Source Control. I’ve found all of the Red Gate products to be really top notch. Again, I haven’t used this one extensively (it’s pretty new), but it is probably worth downloading an evaluation copy at the very least. It integrates with most of the big source control products and is adaptable so that you can make it work with any source control product that has command line functionality.