Click here to Skip to main content
15,914,500 members
Articles / Database Development / SQL Server

Automated Database Change Management Process

Rate me:
Please Sign up or sign in to vote.
1.67/5 (6 votes)
4 May 2007CPOL1 min read 28.2K   253   21   1
The uploaded .NET solution includes the implementation of a database change management process that, if applied correctly, can dramatically reduce the time you spend synchronizing various versions of application databases in development, staging, and production environments.

Introduction

If you've arrived at this page, you've most likely come by way of the 2007 Austin .NET User Group (ADNUG) Code Camp. The attached software contains the software elements of a comprehensive Database Change Management process. It simplifies the process of keeping multiple database environments in synch (i.e., development, staging, and production). The process works by allowing developers to commit SQL scripts to the source code repository alongside their other code files. A NAnt build script is also included which will actually execute these scripts in order against a specified database. In addition to storing SQL schema change scripts, the Northwind.Database project in the solution stores database creation scripts. As a result, the included NAnt script can be used to easily create a new database instance or update any existing instance managed by the process.

Using the code

To begin using the attached solution, you must have either SQL Server 2005 or SQL Server 2005 Express. Simply follow these steps to set up the solution and watch the database change management process in action:

  1. Open solution trunk\source\Northwind.sln.
  2. Build the solution.
  3. Set Northwind.DatabaseUpdater as the Startup project.
  4. Run the solution (which will execute Northwind.DatabaseUpdater).
  5. Make sure the following five settings are selected on the form that appears, and click the Update button.
    • Action = Update
    • Type = SqlServer200x
    • Server = SQL Server 2005 instance name (.\SQLExpress by default)
    • Database = Northwind
    • Username and Password = Leave blank
    • SSPI (integrated security) = Checked

Note: if you change the server name to something other than .SQLExpress, you'll need to update TestingConnectionStringProvider accordingly.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralA similar approach to the one I'm trying to promote Pin
MaxGuernsey24-Feb-08 19:56
MaxGuernsey24-Feb-08 19:56 
I'm trying to promote an approach very much like this one. I'm not certain what it buys us to link the automated build process and the construction of a new database, though. I like that you are focusing on creating a reliable build tool and I think that having the time that a database is built decoupled from the time it is defined might be something to think about.

Max Guernsey, III
Managing Member, Hexagon Software LLC
http://www.hexsw.com
http://www.dataconstructor.com

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.