<P> To understand RESTRICT (and CASCADE) better, it may be helpful to notice the following difference, which might not be immediately clear . The referential action CASCADE modifies the "behavior" of the (child) table itself where the word CASCADE is used . For example, ON DELETE CASCADE effectively says "When the referenced row is deleted from the other table (master table), then delete also from me". However, the referential action RESTRICT modifies the "behavior" of the master table, not the child table, although the word RESTRICT appears in the child table and not in the master table! So, ON DELETE RESTRICT effectively says: "When someone tries to delete the row from the other table (master table), prevent deletion from that other table (and of course, also don't delete from me, but that's not the main point here)." </P> <P> RESTRICT is not supported by Microsoft SQL 2012 and earlier . </P> <P> NO ACTION and RESTRICT are very much alike . The main difference between NO ACTION and RESTRICT is that with NO ACTION the referential integrity check is done after trying to alter the table . RESTRICT does the check before trying to execute the UPDATE or DELETE statement . Both referential actions act the same if the referential integrity check fails: the UPDATE or DELETE statement will result in an error . </P> <P> In other words, when an UPDATE or DELETE statement is executed on the referenced table using the referential action NO ACTION, the DBMS verifies at the end of the statement execution that none of the referential relationships are violated . This is different from RESTRICT, which assumes at the outset that the operation will violate the constraint . Using NO ACTION, the triggers or the semantics of the statement itself may yield an end state in which no foreign key relationships are violated by the time the constraint is finally checked, thus allowing the statement to complete successfully . </P>

What is the purpose of primary key and foreign key