Version Aware Database Schema Deployment
Copyright © 2008 : Ash Tewari
DbUpdater is a free tool that
helps you implement the database schema version control system
described by K. Scott Allen in this set of articles :
- First read the articles listed above. The file prefix for change
scripts is “db”, by default. You can change it in the config file.
DbUpdater supports the baseline script as well as post-scripts.
- Make sure the database you are going to put under version control is already created.
- Specify the connection string in the DbUpdater.exe.config file. Use the connection_string parameter.
- You can use %ServerName%, %DbName%, %UserName% and %Password%
place-holders. You will specify the values for these in the commandline
parameters of DbUpdater.exe.
- Make sure that the “exe-file” value in the config file is pointing to the program you want to use to execute sql scripts.
- Use “exe-args” value to specify commandline parameters for the
program specified in “exe-file”. %SqlFile% placeholder will be used at
runtime to pass the sql script file to the program.
- Here is a sample commandline to run DbUpdater – DbUpdater.exe SqlScripts /server:(local)\SQLEXPRESS /db:TestDb /confirm:true. “SqlScripts” is the name of the folder where the change scripts are placed (relative to the current directory).
- To test drive the program create a database named “TestDb” in the “(local)\SQLExpress” instance and use the included sample-command-line.bat to run DbUpdater. Review the contents of included “SqlScripts” folder.
Other Resources :