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


Please Help Members By Posting Answers For Below Questions

Explain aggregate functions?

843


What are the steps to insert a table?

736


What is the difference between update lock and exclusive lock?

706


Explain the types of indexes.

878


Can you force a query to use a specific index?

740


Which tcl commands are available on the sql server?

825


How can sql injection be stopped? : sql server security

755


If the job running very slow what is the action you do

1630


What is the guest user account in sql server? What login is it mapped to it? : sql server security

802


How do I delete a sql server database?

778


What are the fixed server level roles? : sql server security

800


Is foreign key unique?

797


Do you know hot add cpu in sql server 2008?

754


role of sql sever 2005 in database rather than any other database

1761


What are orphan records?

743