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

What does executeupdate return?

539


Write a sql query to display the current date?

634


Explain what is sql server english query?

530


what are the reporting service components in SSRS?

118


Explain different types of BACKUPs avaialabe in SQL Server? Given a particular scenario, how would you go about choosing a backup plan?

578






How to provide column names in insert statements in ms sql server?

606


explain extended properties

561


What are subqueries in sql server? Explain its properties.

543


What are the difference between “where” and “having” clause in sql server?

583


how many type of indexing in database?

579


Can I disable or restrict ssrs export formats (rendering formats)?

108


Explain features of analysis services?

523


What is the difference between row_number and dense_rank?

442


which table keeps the locking information? : Sql server administration

517


What are parameterized reports? What are cascading parameters in ssrs reports?

100