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 importance of a recovery model?
Explain relational data?
Can you type more than one query in the query editor screen at the same time?
Data table as parameter in sql server?
What are views used for?
What is tablesample?
What is index fragmentation in ms sql server?
Why should we go for stored procedures? Why not direct queries?
What is the size of transaction log file?
what is a self join? Explain it with an example? : Sql server database administration
How to make conditional sum in ssrs?
I have triggers,views,functions,stored Procedures for a table. When I am dropping that table which objects are deleted?
What is an index in a database?
What are the advantages of mirroring?
What is sql server profiler trace data file?