We develop and maintain our database schema with a custom tool. SQL scripts and runtime files are generated from that tool. However, it does not provide a very good visual representation.
Lately I been using Visio to reverse engineer the schema. This is working great so far. But to be able to do this, I need to:
I really want to automate this process. Step 1 and 2 are easy, but how can I automate the other steps.
I've been looking for a C# library to create Visio diagrams, but they al seem not suitable for this task.
For instance http://visioautomation.codeplex.com/ and http://www.graphviz.org/ look promising, but on a closer look they were not appropriate.
I've tried to record macro, but the macro recorder does not work in conjuction with the reverse engineering tools.
In your database model diagram, on the Database tab, click Reverse Engineer. On the first screen of the Reverse Engineer Wizard, do the following: Select the Microsoft Visio database driver for your database management system (DBMS).
Connect SQL Server Data to DiagramsOn the Data tab, click Link Data to Shapes. Select the ODBC option and select ODBC DSN. Select the DSN for SQL Server, select the table you want to import, and finish the wizard. This article uses Orders as an example.
Some tools like Power BI can map out the relationships between data tables using automated intelligence. Instead of building the model from scratch, you can go in and make some adjustments here and there. Using Visio allows modeling the data for other tools as well.
Michiel,
I am using Visio 2007 and SQLite 3.
Tonight I had a crack at reverse engineering my Sqlite3 database with success. The key is to download an ODBC driver for Sqlite. I found some here > http://www.ch-werner.de/sqliteodbc/. I installed the current one at the top of the list "sqliteodbc.exe".
Then the MSVisio set up was a bit muddled so forgive me if I do not explain the details in an exact, repeatable format.
Warning! You are using a Visio 'ODBC Generic Driver' to connect with a 'SQLite' DBMS datasource. By using an incompatible driver, it is possible that the catalog information retrieved will be incomplete.
Just click 'OK' and ignore this.
Unfortunately, in the next screen the option to select "Views" and "Triggers" are greyed out (you can select Tables: Primary Keys, Indexes, Foreign Keys though). This is a shame as I have defined a lot of these in my schema and I have benefited from rev-enging these in Oracle many times in the past.
That is it. Hope someone can find a fix for rev-enging the views.
Dan
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With