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 are various limitations of the views?
What are the different types of collation sensitivity?
Why Master database is required?
How to use go command in "sqlcmd"?
What the different components of Replication and what is their use?
Write SQL queries on Self Join and Inner Join.
Can we write a distributed query and get some data which is located on other server and oracle database?
How to transfer a table from one schema to another?
What are the rendering extensions of ssrs?
What it means to be triggered?
Differentiate between a having clause and a where clause.
How do you send email on SQL Server?
What are the basic functions for master, msdb, model, tempdb and resource databases?
How to use values from other tables in update statements in ms sql server?
What stored by the tempdb ? : sql server database administration