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
Why plvtab is considered as the easiest way to access the pl/sql table?
How to change a value of the field ‘salary’ as 7500 for an employee_name ‘john’ in a table employee_details?
Can primary key be changed?
How to get each name only once from an employee table?
What is identity column in sql server?
What is a ddl command?
What does truncate mean in sql?
What is partition by in sql?
If i can use sys.check_constraints to display my constraints from my database using sql server 2005, how can i display then if i am using sql server 2000????
What are different types of queries in sql?
Does truncate need commit?
Why sql query is slow?
What is clustered index in sql?
What is the syntax and use of the coalesce function?
Is big data nosql?