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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Munesh SharmaPosted Apr 17, 2014, 1:12 PM
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.
Abhishek JaiswalPosted Apr 17, 2014, 12:35 PM
click this
http://www.dbforums.com/mysql/1638962-different-between-no-action-i-restrict.html
:)
Ring ZhongPosted Dec 13, 2013, 2:56 AM
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