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..

 

Comments

# Rajesh said:

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

Monday, September 22, 2003 11:01 AM
# Rob said:

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???

Friday, December 12, 2003 3:01 PM
# Hendrik said:

Same here..

Wednesday, January 21, 2004 7:26 AM
# Doug said:

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?

Wednesday, January 28, 2004 11:20 AM
# Kev McCabe said:

Found this
http://objectrolemodeling.com/posts/214.aspx

Done the trick for me hope this helps

Monday, February 09, 2004 9:46 AM
# Peter Ritchie said:

Another way that I've found works well (the VBA code at ObjectRoleModeling.com didn't work for me in Visio 2000 Enterprise SR-1) is to create a new database model document select all elements in the original document (Ctrl+A) and copy them. Then, paste those elements into the new document. Any non-visible elements (e.g. orphans) will not get copied. You'll have to reconnect to your database...

Friday, February 13, 2004 2:08 PM
# sonix said:

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...

Monday, March 22, 2004 10:49 AM
# Rola said:

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?

Thursday, March 25, 2004 2:55 AM
# Mads said:

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.

Thursday, March 25, 2004 5:35 AM
# visiosux said:

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

Friday, April 02, 2004 2:08 PM
# Miguel said:

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...

Friday, April 30, 2004 1:39 PM
# sermojohn said:

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?

Monday, May 03, 2004 9:01 AM
# jophy said:

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

Friday, July 30, 2004 5:16 PM
# TrackBack said:
Wednesday, April 13, 2005 8:19 AM
# TrackBack said:
Thursday, April 14, 2005 11:13 AM
# ssanchezz said:

After opening a visio object from a word document -> Database properties are not available anymore in Visio.

Anyone how to fix this?

Wednesday, August 22, 2007 7:57 AM
# Gadgetude said:

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

Thursday, July 10, 2008 12:31 PM
# Paul said:

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.

Wednesday, October 22, 2008 5:47 PM

Leave a Comment

(required) 
(required) 
(optional)
(required)