Visio supports database modeling, but the Professional version does not include the forward engineering function, that is, SQL cannot be generated. This is really annoying. Fortunately, there are tools like orthogonaltoolbox. This is a very interesting software. After installation, it does notProgramMenu item, cannot be started directly, but adds a toolbar to other applications.
You can open a database model created by visio in orthogonaltoolbox, export it to XML, and select "er to SQL XSLT transform" as the style. Then open the XML in IE to see the SQLCode.
This XSLT is designed for ms SQL Server, but it is easy to modify it to generate SQL statements for other databases, or it is also a good idea to replace regular expressions directly in the generated SQL text.
Http://blog.csdn.net/pinxue/archive/2006/10/05/1322090.aspx
Installation instructions
To install orthogonal toolbox:
- download the ZIP file and extract the contents of the ZIP file to any (temporary) location.
- Run (START | run... Then browse... To the extract location) setup.exe.
- follow the instructions of the installation utility.
- once installation is complete, you can access orthogonal toolbox by opening/Creating An ORM source model and/or a database model dimo-within Visio.
- look for the toolbar titled "orthogonal toolbox". If the toolbar is not visible, it can be made visible via View | toolbars | orthogonal toolbox.
- once the toolbar is visible, you can use the utility by clicking the button labeled "orthogonal toolbox".