What is the difference between constraints and triggers?
Answer Posted / sairam
Both will be used to implement business rules.
Constraints will do memory location to table comparision.
where as triggers will do table to table comparision.
for this triggers will use magic tables(inserted,deleted).
In the order of precedence first Constraints next Triggers,
But performance wise triggers will give best performance
because table to table comparision is faster than memeory
location to table comparision.
Is This Answer Correct ? | 17 Yes | 8 No |
Post New Answer View All Answers
What is the security principal at the server level that represents your session?
What is difference between delete & truncate commands?
How to create a view with data from multiple tables?
What are different types of constraints?
What is “asynchronous” communication in sql server service broker?
What are the different types of upgrades that can be performed in sql server?
What is the bookmark lookup and rid lookup?
How to write the storeprocedure with in the store procedure? and how can we write the store procedure with in a trigger vice versa? plz post me the exact answer?
What are temporal tables in sql server 2016?
What are the properties of primary key?
How to include text values in sql statements?
How to rename an existing table with the "sp_rename" stored procedure in ms sql server?
What is sql server english query?
How do you start single user mode in clustered installations?
How to delete database objects with "drop" statements in ms sql server?