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 importance of a recovery model?

773


Explain relational data?

704


Can you type more than one query in the query editor screen at the same time?

772


Data table as parameter in sql server?

721


What are views used for?

779






What is tablesample?

766


What is index fragmentation in ms sql server?

771


Why should we go for stored procedures? Why not direct queries?

748


What is the size of transaction log file?

657


what is a self join? Explain it with an example? : Sql server database administration

651


How to make conditional sum in ssrs?

148


I have triggers,views,functions,stored Procedures for a table. When I am dropping that table which objects are deleted?

779


What is an index in a database?

708


What are the advantages of mirroring?

736


What is sql server profiler trace data file?

783