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

Tell me the difference between clustered and non-clustered index?

520


What is the ‘fillfactor’?

568


What’s the distinction between dropping a info and taking a info offline?

600


what are different types of backups available in sql server? Given a particular scenario, how would you go about choosing a backup plan? : Sql server database administration

522


How many types of relations are there between dimension and measure group? : sql server analysis services, ssas

760






What is “asynchronous” communication in sql server service broker?

547


What are the drawbacks of reporting in ssrs?

108


Tell me what is fill factor?

560


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

587


Working with TLogs

1453


Where cross join is used?

519


Can the query output be sorted by multiple columns in ms sql server?

557


How you trouble shoot when any job fails

1509


What is difference between primary key and foreign key?

483


Retrieve the unique rows from table without using UNIQUE and DISTINCT keywords.

593