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
Explain various On-Delete options in a DB table. Which is the default option?
Which are the important points to note when multilanguage data is stored in a table?
What are the encryption mechanisms in sql server?
What are filegroups in sql server?
What are different type of Collation Sensitivity?
Can sub report data source be different from that of the parent report?
If a user does not have permission to a table, but has permission to a view created on it, will he be able to view the data in table?
Is a null value equal to anything? Can a space in a column be considered a null value? Why or why not?
what are the different ways of moving data/databases between servers and databases in sql server? : Sql server database administration
What is the return type of executeupdate ()?
How to loop through result set objects using odbc_fetch_row()?
What is 'Join' and explain its various types.
How to connect Azure federated root database and apply federation in entity framework?
What is the difference between seek predicate and predicate?
What stored procedure would you use to view lock information?