Disabling a Foreign Key Constraint with INSERT and UPDATE Statements

Select the option to disable a foreign key constraint during INSERT and UPDATE transactions if you know that new data will violate the constraint or if the constraint applies only to the data already in the database.

To disable a foreign key constraint with INSERT and UPDATE statements

  1. In your database diagram, select the table that the foreign key constraint is attached to.

  2. Right-click the table and select Properties.

  3. Choose the Relationships tab.

  4. Select the relationship from the Selected relationship list.

  5. Clear the Enable relationship for INSERT and UPDATE check box.

After you add or modify data, you should select this option if you want to ensure the constraint applies to subsequent data modifications.

Note   If you plan to use triggers to implement database operations, such as cascade updates or cascade deletes, you must disable foreign key constraints in order for the trigger to run.