Sql – Maintaining stored procedures in source control

sqlstored-proceduresversion control

How do you guys maintain your stored procedures? I'd like to keep versions of them for a few different reasons.

I also will be setting up cruisecontrol.net and nant this weekend to automate builds.

I was thinking about coding something that would generate the create scripts for all tables/sprocs/udf/xml schemas in my development database. Then it would take those scripts and update them in source control every couple hours…. Ideally, I'd like to make this some sort of plugin/module for cruisecontrol.net.

Any other ideas?

Best Answer

We use Red Gate's SQL Toolbelt at work for this very purpose. Works like a charm.

http://www.red-gate.com/