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

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 pk connections

Author  Topic 

magmo
Aged Yak Warrior

558 Posts

Posted - 2010-02-04 : 16:02:33
Hi

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

http://aspalliance.com/ArticleFiles/1007/image004.jpg

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-02-04 : 16:09:21
It's called referential integrity. You link tables together via foreign keys.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

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

magmo
Aged Yak Warrior

558 Posts

Posted - 2010-02-05 : 06:51:49
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

Kristen
Test

22859 Posts

Posted - 2010-02-05 : 07:50:32
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.
Go to Top of Page

magmo
Aged Yak Warrior

558 Posts

Posted - 2010-02-05 : 08:17:36
Ahh, thanks!
Go to Top of Page
   

- Advertisement -