hi, iam total confused,,,what is the Difference between No Action and Resrict in table on msql ?
i think both are same ...have any differenc?
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Ring ZhongRank #6,843 · 255 reputationPosted Dec 12, 2013, 9:56 PM EST
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.
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.
refer:http://en.wikipedia.org/wiki/Foreign_key
Abhishek JaiswalRank #126 · 17.5K reputationPosted Apr 17, 2014, 8:35 AM EDT
click this
http://www.dbforums.com/mysql/1638962-different-between-no-action-i-restrict.html
:)
Munesh SharmaRank #174 · 13.9K reputationPosted Apr 17, 2014, 9:12 AM EDT
In the SQL 2003 standard there are 5 different referential actions:
CASCADE RESTRICT NO ACTION SET NULL SET DEFAULTThe difference between NO ACTION and RESTRICT is that according to the standard, NO ACTION is deferred while RESTRICT acts immediately.
NO ACTION: A keyword from standard SQL. In MySQL, equivalent to RESTRICT. InnoDB rejects the delete or update operation for the parent table if there is a related foreign key value in the referenced table. Some database systems have deferred checks, and NO ACTION is a deferred check. In MySQL, foreign key constraints are checked immediately, so NO ACTION is the same as RESTRICT.