What is the difference between constraints and triggers?

Answer Posted / sairam singh

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 ?    4 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define cross join in sql server joins?

658


What is the temp table?

622


When would you use a before or after trigger?

570


What is the syntax for encrypting a column in SQL Server?

649


How many types of schemas are there?

604






What is database isolation in sql server? : sql server database administration

657


How can you ensure that the database and sql server based application perform well?

721


What is difference between index seek vs. Index scan?

712


Explain full-text query in sql server?

620


You have modified 100 store procedures and want to replicate these changes from development to prodution, and production can have users using the Server/DB, how would you replicate without causing issues?

1809


What is row_number()?

694


What is user-defined multi-statement table-valued function?

723


Why we use trigger in sql server with example?

605


Does partitioning ssd reduce performance?

567


How can we determine what objects a user-defined function depends upon?

593