I've created a Database Model relationship diagram in Visio with tables and relationships. However, I can't find any way to automatically display the Primary Key :: Foreign Key relationship in the diagram. The only workaround I can find is to insert a text box on top of the relationship and manually type it in (see image). Or you can kinda do the same by naming the relationship and displaying that. However, both of these are very manual and time-consuming. Plus I've already defined the relationship, so why should I have to type it in again!?
Asked
Active
Viewed 6.0k times
2 Answers
8
I realize that this post is old, but just in case you have not found an answer: http://office.microsoft.com/en-us/visio-help/define-a-relationship-in-a-database-model-diagram-HA010115484.aspx#BM4 (Section Show relationships and their properties in a diagram).
Hope this helps!

Allen
- 96
- 1
- 1
6
As far as I know, what is in ER modeling known as "role" cannot be automatically displayed on the relationship line. However, foreign keys should be marked automatically in the child table, provided the parent and child fields are properly connected in the relationship's definition:

Branko Dimitrijevic
- 50,809
- 10
- 93
- 167
-
1Thanks, @Branko! My FK's are displayed in the child table; however, my reasoning behind wanting the relationship displayed on the line is our DB structure is complex and some tables have multiple references to other tables. Thus, where you have FK1 displayed in your image, I sometimes see "FK1, FK2, FK3" along with many other tables involved in multiple relationships. – hurleystylee Aug 20 '12 at 20:44
-
2Unfortunately none of this is available in Visio 2013. – Eat at Joes Mar 03 '13 at 17:25
-
@EatatJoes Visio 2013 is extremely disappointing from the little of it I've used. – hurleystylee Oct 17 '13 at 18:07
-
1I have a minor question, how do you display FK next to a foreign key? I can only display PK for my primary key. How can I do that in Visio? – Kala J May 29 '14 at 16:48
-
@KalaJ Well, just select the relationship (i.e. line between entities) and do what is shown above. FKx should be displayed automatically, at least it is under Visio 2007 - I'm not sure how newer versions behave. – Branko Dimitrijevic May 30 '14 at 11:30
-
Oh I think the reason why it's not working for me is the Foreign key has a different name than the primary key in the parent table. Is there a way to just assign foreign key without the connectors? – Kala J May 30 '14 at 15:45
-
@Kala Nope. Visio somehow needs to know that there is a connection, and this is a way to tell it that. – Branko Dimitrijevic May 30 '14 at 16:21
-
@SachinS Depends on the diagramming tool. In this particular case I have used Visio, and it doesn't care to point to either PK or FK in the main diagram - it just routs the relationships between entities, not specific attributes. The exact attributes being connected can be seen in the relationship's Properties pane, as shown in the screenshot. – Branko Dimitrijevic Nov 04 '16 at 08:05