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
What is the difference between Triggers and Stored Procedure?
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
explain different levels of normalization? : Sql server database administration
Mention the 3 ways to get a count of the number of records in a table.
Mention the differences between sql server and mysql.
What is an execution plan?
What is the difference between clustered and a non-clustered index?
what stored procedure can you use to display the current processes? : Sql server administration
How to deploy the Report?
Do you know what is fill factor and pad index?
What happens if you add a new index to large table?
What have included columns when we talk about sql server indexing?
Explain what are the different index configurations a table can have?
Explain transaction server consistency?
What is key set driven?