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


Please Help Members By Posting Answers For Below Questions

What is the difference between explicit and implicit cursors in oracle?

504


What is record variable?

542


How do I view a sql trace file?

556


Mention what is the function that is used to transfer a pl/sql table log to a database table?

478


How are functions and procedures called in PL/SQL?

584






what does the t-sql command ident_current does? : Transact sql

535


what is auto increment? : Sql dba

563


What is cursor and why it is required?

547


Is primary key an index?

529


Do foreign keys improve performance?

538


What is full join?

517


what is offset-fetch filter in tsql? : Transact sql

529


what is a table called, if it has neither cluster nor non-cluster index? What is it used for? : Sql dba

518


What are the set operators in sql?

545


What is synonyms?

567