Cannot create foreign key to an unenforced primary key or unenforced unique constraint.
Item |
Value |
---|---|
SQLCode |
-1008029 |
Constant |
EMSG_NOFKEY_TO_UNENFORCED |
SQLState |
QNA29 |
ODBC State |
ERROR |
You need to drop the unenforced primary key or unique constraint first. Next, add the primary key or unique constraint via the ALTER TABLE statement. Execute a second ALTER TABLE statement to add the foreign key constraint again.