Adding a Foreign Key |
Creating a foreign key consists of several phases. The first phase consists of selecting the table that contains the referencing columns, selecting the columns, and naming the foreign key. Foreign key columns in the referencing table must map exactly to the primary key columns or unique index columns of the referenced table. The number of columns that are used in the foreign key and the schema of those columns must be the same in both the referencing and referenced tables.
Related topic:
Setting
Foreign Key Options
Checking Dependencies
Modifying Table Schema