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

Difference between report and query parameter.

579


Explain the use of containers in ssis and also their types?

505


What is dbcc? Give few examples.

551


Mention the differences between sql server and mysql.

491


How do you create an execution plan?

475






What is query optimization process?

500


List the data types available in mssql?

498


How are the exceptions handled in sql server programming?

583


What is the difference between dataadapter and datareader?

520


what is the difference between openrowset and openquery?

571


What is a periodical index?

492


What is simple indexing method?

552


What are the 2 types of classifications of constraints in the sql server?

567


What are the difficulties faced in cube development? : sql server analysis services, ssas

580


How to create a scrollable cursor with the scroll option?

478