Thats quite easily done.

  1. For a foreign key, explicitly set “Enforce Foreign Key Relationship” = No (Default is yes)
  2. Set Cascade Deletes to be No Action instead of Delete

There, now you have a table that will not enforce foreign key relationships !!!

ps : By default when a Foreign key relationship is created, the defaults for the foreign key relationship fields are set to enforce the FK. You have to explicitly set them to No.

Disclaimer : I can think of situations where this behavior is required as in report tables, or some funk de-normalized high performance corner cases. But i would ask you to rethink those cases if ever you come against them.

Advertisements