On Wed, 18 Feb 2015 14:16:32 +0100
Staffan Tylen <staffan.tylen at gmail.com> wrote:

> I suspect that this is wrong as nobody has suggested it but isn't
> this what triggers are meant to solve?

Triggers were invented before SQL defined what we now call Declarative
Referential Integrity (DRI).  It is (I'm going to say) always
preferable to declare your integrity constraints rather than
programming them imperatively.  

If you find yourself in a situation in which DRI is insufficient,
it's a good idea to look for a normalization problem or consider if the
trigger is being "abused", i.e., being used for something other than
referential integrity enforcement.  There are exceptions, but not
many.  

--jkl

Reply via email to