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:
- Open solution trunk\source\Northwind.sln.
- Build the solution.
- Set Northwind.DatabaseUpdater as the Startup project.
- Run the solution (which will execute Northwind.DatabaseUpdater).
- 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.