SQL Server Performance

Create a Foreign key on Non-Primary key

Discussion in 'SQL Server 2005 General Developer Questions' started by sudiptakr, Dec 22, 2006.

  1. sudiptakr New Member

    I want to create a Foreign key constraint on A Non -Primary key column of table. is it possible in sql server.
    when i am doing so i am getting error
    There are no primary or candidate keys in the referenced table '<table name>' that match the referencing column list in the foreign key 'fk_name'.
    reply quickly..........................................

    Regards
    Sudipta K. Ghosh
  2. Adriaan New Member

    If not a Primary Key, then the other option for a foreign key is that the parent column(s) has (have) a UNIQUE index.

    It's purely logical for foreign keys: the key must be unique, like a key for a lock.

Share This Page