Sybase Error – Cannot create foreign key constraint on a candidate key that is also a foreign key.

In this blog post, you’ll learn more about the Sybase Error Cannot create foreign key constraint on a candidate key that is also a foreign key. and the reason for receiving this error

Sybase SQL Error Message

Cannot create foreign key constraint on a candidate key that is also a foreign key.

Reason for this Error

A candidate key cannot also be a foreign key. Here’s an example illustrating what is meant by this exception. (1) A [pk] <—– B [fk] [pk] <– ADD THIS ONE — C[fk] (2) A [pk] <– ADD THIS ONE — B[fk] [pk] <——- C[fk] In case (1), adding foreign key C[fk] is disallowed. In case (2), adding foreign key B[fk] is disallowed.