SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

magmo
Aged Yak Warrior

509 Posts

Posted - 02/04/2010 :  16:02:33  Show Profile  Reply with Quote
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

USA
36851 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
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

509 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

Kristen
Test

United Kingdom
22403 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

magmo
Aged Yak Warrior

509 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  
 New 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.09 seconds. Powered By: Snitz Forums 2000