Setting Foreign Key Options

How To

Foreign key and their options can be specified. The following table shows the effect of available foreign key options.

 

Foreign Key Option

Description

Set Null

Records in the foreign key column are set to Null if the corresponding records in the primary key or unique index column are updated or deleted.

Cascade

The corresponding records in the referencing table are also updated or deleted.

Set Default

The foreign key record is set to a default value if corresponding records in the primary key or unique index column are updated or deleted.

No Action

There is no action on the foreign key column if corresponding records in the primary key or unique index column are updated or deleted.

Table: Foreign Key Options