Take the 2-minute tour ×  I'm trying to find out whether I
should be using business critical logic in a trigger or
constraint inside of my database. So far I've added logic in
triggers as it gives me the control over what happens next and
means I can provide custom user messages instead of an error
that will probably confuse the users.  Is there any noticable
performance gain in using constraints over triggers and what are
the best practices for determining which to use.  share|improve
this question @hades, consider taking away all sql server
references. I think the question and the answers are database-
agnostic. –  Sklivvz Sep 29 '08 at 13:17 add comment  12 Answers
up vote 11 down vote accepted  Constraints hands down!    • With
constraints you specify relational principles, i.e. facts about
your data. You will never need to change your constraints,
unless some fact changes (i.e. new requirements).    • With
triggers you specify how to handle data (in inserts, updates
etc.). This is a "non-relational" way