Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 pk connections
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Aged Yak Warrior

558 Posts

Posted - 02/04/2010 :  16:02:33  Show Profile  Reply with Quote

When I drop 2 tables into the visual studio's linqdataclasses context window the tables primary keys (that are associated) get a line between them automatically, how do they get that, like in this picture..

Almighty SQL Goddess

38200 Posts

Posted - 02/04/2010 :  16:09:21  Show Profile  Visit tkizer's Homepage  Reply with Quote
It's called referential integrity. You link tables together via foreign keys.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

Aged Yak Warrior

558 Posts

Posted - 02/05/2010 :  06:51:49  Show Profile  Reply with Quote
Thanks for the info.

I tried to check how this can be set when designing tables, but the only thing I found was that I could do that by altering tables, isn't is possible to configure this using the sql server management studio?
Go to Top of Page


United Kingdom
22859 Posts

Posted - 02/05/2010 :  07:50:32  Show Profile  Reply with Quote
Right click table : "Design"

Chose menu option "Table designer : Relationships"

Select an existing relationship, or press [ADD] to create a new one

Next to "Tables and Column specification" press the [...] button and choose the column(s) from the current table and the Table, and Column(s) from the new corresponding table that you want to make a relationship with.

Edited by - Kristen on 02/05/2010 07:51:26
Go to Top of Page

Aged Yak Warrior

558 Posts

Posted - 02/05/2010 :  08:17:36  Show Profile  Reply with Quote
Ahh, thanks!
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000