Open source tool simplifies database synchronization for SQL Server
Serdar Yegulalp, Contributor
I don't think I've ever worked on just one copy of a given database at a time, especially
for a public-facing project. There has always been at least two copies -- the public version and
whatever iterations I've used privately for development and testing. Keeping the schemas for the
two in sync was usually something I did by hand, if only because I was used to doing so. Old habits
die very hard indeed.
I've since come across a tool that could help make this part of the job much less tedious. It's
called
Premium Access
Register now for unlimited access to our premium content across our network of over 70 information Technology web sites.
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy
This was first published in March 2010
OpenDBDiff, a free
open
source database schema synchronization tool for SQL Server that's hosted on Microsoft's
CodePlex website. It is
GPLv2 licensed, which means you can use it internally for whatever you want.
You can also redistribute the unchanged version of it as you like, but any changes you make to a
redistributed version have to be published. The program doesn't need to be formally installed; you
can unpack the binaries and support files into any folder and run them from there.
OpenDBDiff works by comparing the schemas of any two databases, noting the differences, and
generating a synchronization script. The two databases do not have to be hosted on the same
instance of SQL Server or even reside on the same computer; if you can connect to the database over
the network, then you can sync to or from it. Each conversion scenario can be saved as a project
file and filtered by object type, compared with case sensitivity either on or off, and constrained
with a number of other parameters. The generated change script can then be copied out and run at
your leisure, so it's not possible to accidentally trash a database schema with this program.
Note that the documentation for the program is pretty skimpy—as in, there's barely any at all.
It took some trial and error (and studying of screenshots) before I realized the Server Host field
for the source and destination databases needs to be filled out in the format
SERVERNAME\INSTANCENAME. In other words, if you have a computer named MYSERVER and a
SQL Server instance named SQLEXPRESS, you'd use MYSERVER\SQLEXPRESS to connect to it.
For me, a more intelligent bit of user interface design would be to place the host and instance
names in separate boxes.
Another version of the project also exists, dubbed sql-dbdiff. That one is GPLv3 licensed, and
sports some extra capabilities. One example is a feature called Visual Diff that shows the changes
between the create script for the old and new versions of a given object. This version of the
program is also being developed a little more quickly, so it's probably the better of the two (even
if it isn't the original).
Figure 1. OpenDBDiff in its sql-dbdiff variant (click to enlarge)
ABOUT THE AUTHOR
Serdar Yegulalp has been writing about computers and information technology for
more than 15 years for a variety of publications, including InformationWeek and Windows Magazine.
Disclaimer:
Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.
Join the conversationComment
Share
Comments
Results
Contribute to the conversation