This project has moved. For the latest updates, please go here.

DBDeploy is actually quite simple to use, but opens up many possibilities for managed database deployments.

Tools for managing this complexity and difficulty are available.  For example, Red-Gate’s Sql Compare is a great tool for doing exactly that.  However, these tools can be expensive and they have a major flaw:  they rely on evaluating changes AFTER those changes have happened.  Often, changes will be missed by these tools, which can lead to aborted production migrations.  Another major issue is that they don’t work well for scenarios where you need to deploy a database update to many clients that may all be at different versions of the database.

DbDeploy.Net helps solve these problems.

Making DbDeploy work requires the following rules:

  1. Every change must be scripted.  This is a good thing:  If it’s scripted, you know it happened, you can version control it, and you can keep track of what changes have been applied to any given database.
  2. Scripts that have been applied to a production environment should never be edited.  Instead, create a new script that does the modification.
  3. If you’re doing DDL (CREATE, ALTER, etc) only include one statement in each script.
  4. Name each of your scripts with a number followed by the description of the script.  For example:  1 My First Script.sql, 2 My Second Script.sql.  The number ensures that they’re executed sequentially, the description will be placed in the changelog table as a description of the script.
  5. Check your scripts into source control.  O.k., not a DbDeploy rule, but a good rule anyway!


Additional things you need to know:

  1. All of your change scripts are wrapped inside of a transaction.
  2. DBDeploy is capable of creating an undo script.  Place the actions that should be done into the script file first, then add the magic token –//@UNDO onto its own line and then below that token, add the steps to undo the script.  This sounds cool, but most people don’t use it (how do you undo a DROP TABLE script anyway?)


For a quick start guide, see the Quick Start Sample

Command Line options are document on the Command Line Help page.

Last edited Sep 4, 2013 at 4:27 PM by rakker91, version 10


No comments yet.