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 varchar and nvarchar?
How to call a function from a stored procedure in SQL Server ?
What happens if time-only values are provided as date and time literals?
What is the recovery model?
What happens if strings are casted into wrong code pages in ms sql server?
How global temporary tables are represented and its scope?
How to generate create view script on an existing view?
Define outer join?
explain different types of joins? : Sql server database administration
What is a document index?
Explain the cursor lock types?
Define magic tables in sql server?
What are relationships and mention different types of relationships in the dbms
What are data resources?
What is service broker?