by luisp
15. April 2011 14:35
Many of us by now are familiar with Visio and its Reverse Engineer capability, where you point Visio to a data source and it can generate a somewhat decent database model of the said database. It’s a pretty handy tool to get you started. But what about taking a database diagram and "forward engineering" it?
Last week I had and project where I needed to normalize a database. The first thing I did was open up Visio and reverse-engineer the existing db. Once I had made all the changes that I wanted to make I downloaded a handy tool from Codeplex that allowed me to "forward engineer" my diagram and generate a script to create the new and improved objects including indexes as well as primary and foreign keys. It is an add-in to Visio and ends up adding a tab to the ribbon for all your Forward Engineering needs.


After I ran that script on a blank database all I had to do then was run a delta comparison using (SQL Delta) of the new database with the new objects against the old database. That gave me an update script to run on the old database. Once that was done the old database was up to date and was fully normalized to the specs of my Visio diagram.