Subject | Are stored procedures in triggers a good idea? |
---|---|
Author | Daniel L. Miller |
Post date | 2005-01-08T01:46:46Z |
I seem to remember reading somewhere that calling stored procedures from
triggers wasn't a good idea. But now I'm not Googling a reference to
that. So I'll ask from scratch:
Other than (what I would think to be minimal) increase in overhead, why
would I NOT want to use stored procedures in triggers? As an example -
if I implement my handy-dandy auto-increment with built-in generator
protection, I want that same before-insert trigger in each of my umpteen
tables. Then, if I later want to change that behaviour - system wide -
I just want to have to change it once. So having a generic before
insert trigger procedure - called with parameters from the before insert
triggers, SEEMS reasonable.
What am I missing?
--
Daniel
triggers wasn't a good idea. But now I'm not Googling a reference to
that. So I'll ask from scratch:
Other than (what I would think to be minimal) increase in overhead, why
would I NOT want to use stored procedures in triggers? As an example -
if I implement my handy-dandy auto-increment with built-in generator
protection, I want that same before-insert trigger in each of my umpteen
tables. Then, if I later want to change that behaviour - system wide -
I just want to have to change it once. So having a generic before
insert trigger procedure - called with parameters from the before insert
triggers, SEEMS reasonable.
What am I missing?
--
Daniel