Visio 2007 Database Model DDL Generation

Well, like many people, I use Microsoft’s Visio to create Database Model Diagrams. And, like many people, after “upgrading” to Visio 2007 Professional, I have been frustrated trying to figure out how to generate Database Definition Language scripts from my Visio diagrams. So I went searching the web, only to find out that DDL Generation is missing from the “Professional” version of the product and there does not seem to be a work-around available – until now.

Given my frustration, I created a script to read the XML version of the Visio 2007 Database Model Diagram and generate the DDL necessary to create a MySQL database based on the Visio diagram. Now that it’s working for me, I am sharing it with you.

For the most part, I am pretty pleased with the results. There are, however, some known limitations. The script will generate the following:

  • DROP TABLE [table-name] IF EXISTS
  • CREATE TABLE [table-name] including:
    • Column definitions
    • Primary Key definition
    • Unique Index definitions
    • Non-Unique Index definitions
  • ALTER TABLE [table-name] ADD FOREIGN KEY [foreign-key-name]

But, at present, you cannot taylor the output to meet your preferences. In addition, some of the Database Model Diagram information is unavailable (or not so easily discernable). This results in either leaving the information out of the generated DDL, or making a best-guess as to what it should be.

Because I am still working on this program, I am making it available as a free service from this website. If there’s enough interest, maybe someday I’ll create a commercial version to be used as a Visio add-on.

Please proceed to the next page if you are interested in using this FREE DDL Generation Service.

Speak Your Mind

Tell us what you're thinking...

You must be logged in to post a comment.

About Whatever is powered by WordPress using a derivative of the Shades of Blue theme by StudioPress