Thursday, August 14, 2008

Err: There is no unique constraint matching given keys for referenced table

Error:
       There is no unique constraint matching given keys for referenced table ...

Solution: 
    The column referred by the foreign key in the main table should be declared as primary key. By chance, that referred column is a part of primary key(ie. more than one field declared as primary key) then it should be declared as unique atleast.



No comments:

Post a Comment