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

What do you understand by the denormalisation?

638


What is a mutating table error and how can you get around it?

618


What’s the use of custom fields in report?

648


What is a periodical index?

577


What are secondary xml indexes?

668






How to make a column nullable?

680


What is dknf in normalization form?

655


How many columns can we include on clustered index ?

582


Which table keeps the locking information?

606


What is a synonym for manipulation?

646


Explain stored procedure?

678


Why Master database is required?

676


Mention the command used to rename the database.

628


Explain insert into select statement?

600


How to create nested stored procedure?

622