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

Difference between report and query parameter. Why do we need different type of parameter?

756


How to sort query output in descending order in ms sql server?

753


How do I determine how many instances of sql server are installed on a computer?

733


Can we perform backup restore operation on tempdb? : sql server database administration

761


How to update multiple rows with one update statement in ms sql server?

871


What is indexed view? How to create it?

769


Explain features and concepts of analysis services?

690


you want to be sure that queries in a database always execute at the maximum possible speed. To achieve this goal you have created various indexes on tables which other statement will keep the database in good condition? : Sql server administration

755


1)what is the difference between Reinitializing a Subscription and synchronization the subscription? 2)when to use reinitializing ? 3)when to use synchronization? 4)when adding table or deleting a table what to do?(reinz.. or syn) 5)when adding a column what to do?

1744


Difference Between ORDER BY Clause and GROUP BY Clause in SQL?

828


What do you understand by coalesce in sql server?

734


What is table valued function and scalar valued functions?

720


Explain filestream storage of sql server 2008?

709


Where to find ntwdblib.dll version 2000.80.194.0?

755


what is unique and xaml nonclustered index

790