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 are the new security features added in sql server 2012? : sql server security

702


What is SQL Azure?

101


Write a SQL command to insert and update only a particular field?

798


What is ssrs?

109


plss anybody specify tha constrian management system in dbms

1800






Name few endpoints exposed by ssrs 2012?

330


Can a table have 2 primary keys?

713


How do you identify a foreign key?

776


What are the differences between user defined functions and stored procedures?

737


What are dml (data manipulation language) statements in ms sql server?

734


To automatically record the time on which the data was modified in a table, which data type should you choose for the column?

718


Explain different forms of normalization?

685


Define the one-to-one relationship while designing tables.

687


What is report subscription?

109


How do I find sql server instance name?

693