Previous Topic: -169 - THE REFERENCED COLUMNS DID NOT REFER TO A CANDIDATE KEYNext Topic: -172 - THE NUMBER OF REFERENCING AND REFERENCED COLUMNS DOES NOT MATCH


-171 - THE REFERENCED TABLE DOES NOT CONTAIN A PRIMARY KEY

Explanation

During a CREATE or ALTER TABLE, you defined a reference to a table without specifying the referenced columns, and the referenced table does not contain a primary key.

The SQLSTATE that equates to this SQL return code is 55S06.

User Response

Define a primary key on the referenced table, or explicitly specify the columns in the foreign key reference definition.