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
Using the customer, and order table in northwind database, please write a query to produce xml?
I have triggers,views,functions,stored Procedures for a table. When I am dropping that table which objects are deleted?
What is the security principal at the server level that represents your session?
What is store procedure? How do they work?
What is difference between foreign key and unique key?
What is sql sandbox in sql server?
What is a transactions?
Is mysql better than sql server?
How to create an identity column?
How to connect to SQL Azure Database by using sqlcmd?
Explain atomicity?
How do you create an execution plan?
What are the properties of the transactions?
What are the recovery models for a database?
What are the differences between triggers and stored procedures?