Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Key Rules

Status
Not open for further replies.

squidster

Technical User
Oct 13, 2002
55
GB
Is it possible for a foreign key in a child table to be a secondary key from the parent table instead of the primary key?
How would this affect referential integritty , if at all?

This is based on the definition that the secondary key is an attribute that will uniquely identify the parent entity record.

This is required really to aid data input as the secondary key will have more meaning to the user.

Hope this makes sense
 
A foriegn key can be any unique column in the parent table. It need not be the primary key.
 
Thanks, I kinda thought so but books I'm reading don't actually say so unambiguously. They allways tend to say a foreign key must relate to a primary key in the parent table.

Tahnks again:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top