MS Visio Coolness

Yesterday I decided to fiddle around with MS Visio for Enterprise Architects database modelling tools. After drawing up and validating a pretty straight-forward use case i created a new Database Model Diagram Template from visio. After telling Visio to use the Sql Server ODBC driver I got all the Sql datatypes correct for my Entity construction. Relationships creates foreign keys automatically.

Usually after designing the ER diagram I've set out to Enterprise Manager for a long day of boring table/view contruction. Now I rather hit Database -> Model -> Error Check in Visio, followed by a very pleasant Database -> Generate. This starts a wizard that generates DDL scripts, and even executes it on your database if it's configured with ODBC. Further alterations are done with the ever so sweet Database -> Update.

The only reason that I haven't discovered this before is that I've always chosen ER Model Diagram Template instead of Database Model Diagram in Visio (which doesn't enable the Generate and Update menuchoices). And sure, there are things that could be better (such as view creation), but still; this saved me at least a day of work! And I don't even have the latest version of Visio.

Can't wait to see potential cool VS.NET integration with Visio in Whidbey. Rational Rose never did it for me anyways. 

Next on the menu is to hook my VS.NET solution up to the database and create some really nice typed datasets with annotations and let VS.NET generate the SP's in the DataAdapter wizard. I'll probably won't have to write a single line of SQL!

Update 07.08.2003:
This article gives a nice intro to the subject. And setting Identity on your tables in Visio might be a little tricky. Select your table, choose the Columns page in Categories inside the Database Properties window. Then choose your primary key column and hit Edit. In column properties choose Data Type and click Edit again. There you should find a checkbox for Identity. Phuuuiii..

 

12 Comments

  • Can you help me on this ?

    -----------------------

    I am using Visio to do database modeling

    When I do Database -> model -> error check

    It shows me one error

    Raference8 : Child column(s) not specified



    When I say -> go to source



    it says

    This relationship is not shown because the entities it is connected to are not placed on the diagram



    How can I find this relationship and delete ?



    Thanks,

    Rajesh

  • I am experiencing the same problem with a mystery relationship. Visio doesn't display the relationship, and cannot update or remove the relationship. Any ideas???

  • I had that same problem. Really didn't find a fix for it except delete the table that the offending relation is connected to and recreate everything.



    I did find that after double-clicking on the error message on the Output tab you can see the offending relation if you switch over to the Database Properties tab. But I never could figure out how to delete it. Like I said above I finally deleted one of the related tables (the child) and recreated everything.



    Anybody else have any better luck deleting this type of "phantom" relation?

  • Hi, I've found a quick way to make your coloumns identity enabled:



    simply cut the phrase "int identity" and paste the over the "int" in your database properties window...

  • Dear,

    I am using Visio 2003 and I am not being able to check error for diagram nor generate database DDL script. I have created a New>Database>Database Model Diagram...

    In the Database menu, the options of generating database do not show.

    Why? Any help? Anybody knows how can I create the DDL script for db generation from a database model diagram?

  • I believe that Generating database and roundtrip engineering with VS.NET is only availible in the Enterprise Architect version of Visio. As far as I know, this version is not yet released in the 2003 version.

  • visio sux, this dangling relationship crap has inspired me to NEVER NEVER NEVER use the database modeling part AGAIN.

  • The same "phantom ralationship" problem

    the solution:

    - Right click on the table with the problem

    - Select "Show related tables", you will get the "phantom" back

    - Select the relationship and delete it



    Good luck...

  • i ve just started to use Ms Visio for a study og database. i have a proble, i can not open the database properties window by double-clicking a table.i need to open it in order to show the keys

    and create the columns.can anyone help me?

  • Thanks Miguel for your great solution (Phantom relationship).Thanks a ton.You saved lot of time for me...

  • Miguel & Sonix - you both rock! Both of your posts were extremely helpful.

  • Re: Miguel's post of Friday, April 30, 2004 1:39 PM. Nice hint, thanks. One further bit: after right clicking, select "Cut" from the context menu. Just using your Delete key won't remove the relationship - not sure why.

Comments have been disabled for this content.