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 provide default values to stored procedure parameters?
Explain about local stored procedure?
What are the different authentication modes in sql server?
How to create stored procedures with parameters in ms sql server?
What is log shipping? Can we do logshipping with SQL Server 7.0 ?
Explain transaction isolation levels in sql server?
Which table keeps information about stored procedures?
Tell me what is difference between view and materialized view?
How do you trace the traffic hitting a sql server?
Explain what is the main purpose of having conversation group?
what is a default tcp/ip socket assigned for sql server? : Sql server database administration
What is model database? : SQL Server Architecture
What is the difference between commit and rollback?
What happens when the SQL Azure database reaches Max Size?
What is sql server locking?