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

Does full backup break log chain?

543


What are ddl triggers and types of ddl trigger?

601


What are scalar functions in sql?

603


Can sql servers link to other servers like oracle?

464


What are the differences between user defined functions and stored procedures?

529






Is BCNF better than 2NF & 3NF? Why?

616


what is a join and explain different types of joins? : Sql server database administration

532


Explain for xml explicit mode?

556


What are the steps to insert a table?

537


What are the differences between clustered and non-clustered index?

532


How exceptions can be handled in sql server programming?

543


What is #table in sql server?

530


How to find table changes in sql server?

658


Do you know what is normalization of database? What are its benefits?

555


Difference between DELETE and TRUNCATE?

613