Source control of tables?

  • I would like to hear what your approach to source control of database tables is.

    Do you source control the create script for the entire table for each modification?

    Do you store multiple change scripts?

  • That's a huge topic. I'd like to suggest you take a look at a book, SQL Server Team-Based Development. It's free (unless you want to get a printed copy). I wrote the chapters on deployment in there.

    I've used two tools to do this, both available. Microsoft has an add-on for Visual Studio frequently referred to as Data Dude. It's documented in the book and does exactly what you're asking. The other tool is Red Gate's SQL Source Control[/url] which is an add-on for SQL Server Management Studio. It's also documented in the book and does what you're asking about as well. Either tool will work for you, but they have different approaches which can satisfy different needs depending on your environment. That's why I recommend checking out the book so you can decide which one is probably better for your situation.

    In general, I try to stay away from storing large numbers of change scripts and instead work with the tools and source control, so that you can rely on that as a means for building your databases. However, both tools can hit snags, especially when it comes to changes that are destructive to data (dropping columns, changing data types, that sort of thing). Then you also need to store change scripts. Actually SQL Source Control is adding some functionality around this to help out.

    Disclosure, I work for Red Gate Software (although I didn't when I wrote the book).

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • We have been looking for a good source control software for a long time. So far we have found only one that looks good for our operation. That is Redgate SQL Source control. We already had one license for it. Currently the BI team is working with it as a test run. If they feel satisfied, our development team will also start using it.

    Disclosure, I DO NOT work for Red Gate Software 🙂

    -Roy

  • Grant Fritchey (8/10/2011)


    That's a huge topic. I'd like to suggest you take a look at a book, SQL Server Team-Based Development. It's free (unless you want to get a printed copy). I wrote the chapters on deployment in there.

    All kindled up and ready to go!

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply