What is the difference between constraints and triggers?

Answer Posted / harshad more

Constraints are great at maintaining database integrity for
database fields and relationships between database tables.

Triggers are great for checking past vs. current values and
making decisions based on that data.

In my experience, it is usually much more favorable to use
constraints when possible and leave the trickier business
and auditing logic for use in triggers.

Is This Answer Correct ?    7 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to fetch the next row from a cursor with a "fetch" statement?

582


What is stored in the mssqlsystemresource database? : sql server database administration

586


Indexes are updated automatically is the full-text index also updated automatically?

619


How can we check the sql server version?

557


What is the filtered index?

555






Is it possible to update the views? If yes, how, if not, why?

539


Explain how to integrate the ssrs reports in application?

518


Explain the advantages of merge replication?

503


What is the downside of using udf?

557


How to optimize stored procedure optimization?

517


What is a subquery in a select query statement in ms sql server?

580


optimization techinques

2192


What are the different types of Indexes available in SQL Server?

516


Which is the main third-party tool used in sql server?

475


Why should one not prefix user stored procedures with ‘sp_’?

590