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 / jerry joseph

Restricting the input using CONSTRAINT will have better
performance but there is a limit to the types of constraints
which we can provide..

With TRIGGERS you have more flexibility and provide a more
variety restrictions to the input.. for example you can
prevent a normal delete and make it a soft delete by setting
an IsDeleted flag using trigger.. we cant have that kind of
flexibility using Constraints..

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between Triggers and Stored Procedure?

575


Help!!!!!!!!!!!! My database has gone offline, it is highlighted as 'Suspect'. Foolishly, i haven't got a recent back up. Is there a way of quickly restoring the database? Thank you

1305


explain different levels of normalization? : Sql server database administration

524


Mention the 3 ways to get a count of the number of records in a table.

555


Mention the differences between sql server and mysql.

512






What is an execution plan?

569


What is the difference between clustered and a non-clustered index?

595


what stored procedure can you use to display the current processes? : Sql server administration

530


How to deploy the Report?

95


Do you know what is fill factor and pad index?

569


What happens if you add a new index to large table?

513


What have included columns when we talk about sql server indexing?

581


Explain what are the different index configurations a table can have?

697


Explain transaction server consistency?

528


What is key set driven?

541