This project is read-only.

Quick Start Guide

Create a new project

  • Fire up DBSourceTools, and click File | New | Project.
  • Enter a Project Name, and a Base Directory.
    • Note that this will create the <Project> directory, as well as a <Project>.dbsp file, and a <Project>.xml file in the base directory.
    • (see screenshots below)
  • Click on the Database Button.
  • Specify a NickName for the database ( this can be anything you like), but I prefer Template_<DatabaseName>
  • Specify connection settings
    • Note that these connection settings will be stored in <Project>.xml
  • Click "Test Connection"
    • (see screenshots below)
  • Once the connection has succeeded, click OK.
  • You will be prompted to load the database.
  • Once all objects have been loaded from the database, the DBExplorer tree will be populated.
    • (see screenshots below)

Specify Objects to Script

  • Before creating a deployment target, you will need to specify which objects to include in the create scripts.
    • This is to cater for the cases where one database is used for multiple systems.
    • Also, in most cases you only need to script data for a specific set of "configuration tables".
  • Double-click on the Source database in DBExplorer.
    • This will show the Source database properties window.
    • (see screenshots below)
  • Select your required options:
    • As an example, for views, select the Views checkbox and then click on the Views Button.
    • The relevant script options screen will be displayed.
    • Click on the Refresh button to load all Views from the database.
    • Select which Views are to be scripted using the checkbox next to each view name.
    • You can also click on Views | Select All to select all views.
    • Save and close.
    • (see screenshots below)
  • Repeat for all Script Options.
  • Scripting Table Data
    • There are two config settings that need to be set in order to script data:
    • Under the Tables Script options Form, you need to select the Script Data column for each table.
    • (see screenshots below)
    • Under the main Script Options screen, you need to select the Data checkbox.

Create a Deployment Target.

  • Once you have specified what objects are to be scripted, you can specify a new Deployment Target
    • Select Database | Add | New Deployment Target, or
    • Right-click on Deployment targets and choose "New Deployment Target"
  • Complete the database connection settings.
    • This will create a deployment target, and both the CreateDB.sql and DropDB.sql files for the deployment target.
    • Note that the create script is based on the original Source Database settings.
    • You can double-click on either of these two files to edit them.

Write Deployment Target.

  • Finally, you need to right-click on the new Deployment Target, and select Write Targets.
    • This uses the scripting options that you specified in order to create the file "RunCreateScripts.bat" that you can see under the deployment target.
    • (see screenshots below)


  • To deploy your target, double-click on the Deployment target in DBExplorer.
    • This will bring up the Deployment Target database setting screen.
    • (see screenshots below)
    • Click on "Deploy target"
    • Click on OK.
    • A new batch-like window will show the results of your deployment.
    • If any errors occcur, they will be highlighted in red.
    • (see screenshots below)
    • Results are automatically saved to Deploy_Results_<date>_<time>.txt
    • (see screenshots below)
  • You can cancel the deployment at any time.

Add to Source control

  • Using your favorite source control system, place your database objects under source control.
  • Check in, commit, and share with your development team.

Screen Shots

New Project

New Database

DBExplorer Tree

Source Database Script Options

View Options


Deployment Results Screen

Deployment Results Screen with errors

Last edited Jul 9, 2009 at 3:55 AM by rozentalsn, version 19


No comments yet.