This project is read-only.

Project Description

DBSourceTools is a GUI utility to help developers bring SQL Server databases under source control. A powerful database scripter, code editor, sql generator, and database versioning tool. Compare Schemas, create diff scripts, edit T-SQL with ease. Better than Management Studio.

New Tutorial

For a step-by-step guide on using DBSourceTools, and a discussion on the principles of database source control, have a look here :
This guide covers the following topics:
  • Introduction
    • No source control of databases
    • Problems with a common DEV database
    • Using an isolated database instance per developer
    • Including your database in source control
  • DBSourceTools
    • Basic usage scenario
    • No source database scenario
  • Benefits of using DBSourceTools
    • Databases are an instance in time
    • Patching
    • Merging changes from other developers
    • TEST, UAT and PROD patching
    • Database compilation
    • Data included
  • Step-by-step Tutorial
    • Create a blank database
    • Loading a source database
    • Creating a Target database
    • Deploying the Target database
  • Creating Patches
    • Adding your Target database as a source
    • Creating and scripting tables
    • Executing queries
    • Saved queries
    • Reloading from database
    • Inserting data
    • Viewing and scripting data
    • Creating patches
    • Including patches in the deployment script
    • Killing databases
    • Verifying the target database
  • Adding files to source control
    • Sharing your database

You happy now, Guy ?

Another New Tutorial

For a step-by-step guide on using DBSourceTools with existing databases, have a look here :
This guide covers the following topics:
  • Scripting Existing databases
    • New Project
    • Adding a Target Database
  • Setting scripting options
    • Including data
    • Reloading
    • Main Options
    • Writing Targets
    • Deploying the Target
  • Common deployment errors
    • Viewing deployment results
  • Adding the Target as a source
    • Checking the number of records

Current Release :


  • Command line version released : DBSourceToolsCmd
  • Auto-detect if project files have changed location, and reload from current directory.
  • Auto-detect if project files need to be saved in above circumstances.


  • Upgraded runtime engine to .NET 4.5
  • Fixed and intermittent bug on explorer tree view.


  • Changed TextEditor from FireEdit to ICSharpCode.TextEditor
    • Highlight both field and table names in scripts ( in blue ) - see screenshot below
    • Re-built Intellisense engine
    • Intellisense now pops up while writing sql scripts
  • DBExplorer Updates
    • Added field dropdown on all tables and views in DBExplorer.
    • Added data option for viewing data in Views.
  • Fixed reported bugs
    • Include Synonyms in scripting engine (nickt_ch)
    • Fixed comment / uncomment (tareq)


To view release history, go here Release History

Help needed testing and updating Intellisense.

While every effort has been made to correctly suggest Intellisense options, I feel that there are a lot more cases that I should be checking for.
If you find that Intellisense is not working for you correclty, please could you send me a sample sql script that I can plug in to the Intellisense engine.
Better yet, send me a patch.
Have a look at the tests in TestICSharpCode.MSSQLExtensions for some Intellisense samples.

Where in the world are you ?

Find out where DBSourceTools is used, or show us where you are :

Wiki Pages:

Quick Start Guide
Using Source Code Control
Using Intellisense

Project Background

Don't use a DEV database server
Too often, developers use a central "dev" database during development.
This leads to any number of frustrating problems:
  • Developers break each others code.
  • Developers get frustrated when someone else breaks their code.
  • Development time is slow.
  • There is no version control over database objects and scripts.

Use a Local database copy
Here's how to alleviate these problems:
  • Give each developer their own local version of the database.
  • Script all database objects to disk, and place them under version control.
  • Easily get the latest version, and re-create your local database.

And lastly...
  • Microsoft SQL Server Management Studio (2005) has a very limited script editor:
    • No automatic begin / end section highlighting
    • No collapsible regions
    • No search facility
    • You have to right-click and select "Script Object as " | "Create to" | "New query editor window" every time you want to edit an object.
    • You have to remember to use ALTER or CREATE in your script when making changes.

Enter DBSourceTools

Inspired by all of the above, as well as Microsoft's Visual Studio for Database Professionals, DBSourceTools was born:

Feature List
  • Tested on SQL 2000, 2005, 2005 Express, 2008 Express, 2008 Dev Edition. (no support for SQL CE).
  • One-click action to script a database to disk.
  • Easily deploy a database through "Deployment Targets".
    • Script from one version of SQL to another
    • From 2000 to 2005 to 2008, or
    • From 2008 to 2005.
  • Verify database integrity during deployment.
    • Automatically takes care of object dependencies.
    • Automatically excludes computed columns on data load.
  • Use the enhanced script-editor to edit tables / stored procedures / etc.
  • Search database scripts.
  • Double-click to edit stored procedures and tables.
  • Double-click to view table data.
  • Dock / float windows


Next >> Quick Start Guide

Last edited Nov 5, 2014 at 8:20 AM by rozentalsn, version 68