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
How to use order by with union operators in ms sql server?
What does it mean if @@cursor_row returns a negative number?
Explain the working of sql privileges?
How to list all field names in the result set using mssql_field_name()?
what's sql server? : Sql server database administration
What is the difference between a local and a global temporary table?
How to perform key word search in tables?
What is sql injection? How to protect against sql injection attack?
Why is there a performance difference between two similar queries where one uses union and the other uses union all?
What is the Disadvantage of indexed sequential file.
What is the difference between the application object and session object?
What is the function of inner join?
What is executereader?
What is a synonym for manipulation?
How to assign null values to variables or columns?