what is the difference between trigger and constraint?
Answer Posted / milind chopde
1) Constraints can be used for validation but trigger can be used for complex validation and auditing purpose.
2) Trigger is database object but constraint not.
3) Trigger can be fired on DDL commands but constraints are created or altered using DDL commands.
4) Trigger can be fired on particular event like before/after DML but constraint always check before any data insert or update to table.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is a recursive stored procedure?
Explain lock escalation? : Transact sql
What is difference sql and mysql?
What is scalar function?
how to analyze tables with 'mysqlcheck'? : Sql dba
Show code of a cursor for loop.
what is a field in a database ? : Sql dba
What is the difference between nested table and varray?
Explain the select statement in sql?
What are variables in pl sql?
Is hadoop a nosql?
What is the cause of mutating table error and how can we solve it?
What is primary and foreign key?
What is the use of non clustered index?
What is data types in sql?