Which is better in performance - CONSTRAINT or TRIGGER over
a column which restricts say an input of particular value
in a column of a table?
Answer Posted / monal
Constraints gets evaluated before statement can be either
inserted or deleted or updated. While trigger executes
after or at the same time statement is executing. So if you
have to roll back transactio because transaction not
meeting condition there is no overhead when you are using
constraint ,but if you have to roll back transaction and
you have a trigger on that table or column either 1
transaction goes through before rolling back. So basically
trigger consumes more resources.
| Is This Answer Correct ? | 7 Yes | 3 No |
Post New Answer View All Answers
What is the return type of executeupdate ()?
You are doing log shipping due to some reasons it is failing. How you will proceed from there
What are transactions in sql?
What are indexes in sql?
How to view the error log for any specific instance? : sql server database administration
How to find the version of sql server? : sql server database administration
What is enhanced database mirroring in sql server 2008?
What is the parse query button used for?
What are the three different part of rdl file explain them?
What is the minimum and maximum number of partitions required for a measure group? : sql server analysis services, ssas
What is function of ROLLUP ?
How to retrieve error messages using mssql_get_last_message()?
Your table has a large character field there are queries that use this field in their search clause what should you do?
How to list all schemas in a database?
What are the types of dml?