Data Browser - Viewing Site  Sector 23 Code Bank Logged in as:  Guest  


Problems creating a foreign key in Sql Server
I got the following error over and over, trying to create a foreign key to a table:
"There are no primary or candidate keys in the referenced table 'name' that match the referencing column list in the foreign key"

It turns out the the column ORDER of the primary key column must be the SAME ORDER as your foreign key reference columns.

Created By: amos 8/15/2006 5:34:30 PM

 > Guest 9/21/2008 1:28:00 PM
I'm not sure I can think of a case in proper database design where you wouldn't want the corresponding indexes in a foreign key relationship to be correlated. Hence the error message?