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 difference between count(*) and count(1) ?
How to change the name of a database user?
do views contain data ?
Explain in brief how sql server enhances scalability of the database system?
Explain what is lock escalation and what is its purpose?
What are the recovery models in sql server 2000?
What are entities and relationships?
Explain indexes disadvantages?
Explain security with sql azure?
What is the maximum size of sql server database?
What is the difference between grant and with grant while giving permissions to the user?
What the different components of Replication and what is their use?
What is the difference between sdf and mdf?
What is the impact on other user sessions when creating indexes?
Explain primary key?