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


Please Help Members By Posting Answers For Below Questions

How to provide default values to stored procedure parameters?

656


Explain about local stored procedure?

600


What are the different authentication modes in sql server?

708


How to create stored procedures with parameters in ms sql server?

613


What is log shipping? Can we do logshipping with SQL Server 7.0 ?

656






Explain transaction isolation levels in sql server?

638


Which table keeps information about stored procedures?

615


Tell me what is difference between view and materialized view?

602


How do you trace the traffic hitting a sql server?

712


Explain what is the main purpose of having conversation group?

613


what is a default tcp/ip socket assigned for sql server? : Sql server database administration

647


What is model database? : SQL Server Architecture

661


What is the difference between commit and rollback?

590


What happens when the SQL Azure database reaches Max Size?

96


What is sql server locking?

619