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
 General SQL Server Forums
 New to SQL Server Programming
 foreign key questions

Author  Topic 

x-jeno
Starting Member

6 Posts

Posted - 2011-07-21 : 07:23:12
hi guys
just a simple question i am currently confused about

a primary key is unique and therefore cannot be repeated, but what about foreign key? can that foreign key have multiple duplicates in a table?

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-07-21 : 07:25:23
Yes why not?
Think about what a foreign key is and why it will be used...


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-07-21 : 07:25:49
yep..you can have multiple references to same foreign key value but value will be a pk in master table ie only one occurance.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -