On 9 September 2010 13:23, silky <[email protected]> wrote:
> On Thu, Sep 9, 2010 at 12:20 PM, David Connors <[email protected]> wrote:
> > PS: Triggers are evil and you're going straight to hell for using one,
> > shortly followed by me for providing this solution.
>
> What's your reasoning on this?
>
It makes the database tier less deterministic:
INSERT INTO whatever VALUES ('blah')
GO
(2 rows updated)
etc
If you end up in a mess with deadlocks it will be harder to unscramble as
you're significantly increasing the potential for locking conflicts.
Keep it simple. Capture the data integrity logic in the schema design with
DRI and stored procs for the stuff that you can't do there, etc.
I would hate to see an application that made very heavy use of triggers as a
matter of course.
I have a feeling I am about to end up in one of those discussions where I am
on the opposite end of the opinion spectrum to the rest of the Internet.
--
*David Connors* | [email protected] | www.codify.com
Software Engineer
Codify Pty Ltd
Phone: +61 (7) 3210 6268 | Facsimile: +61 (7) 3210 6269 | Mobile: +61 417
189 363
V-Card: https://www.codify.com/cards/davidconnors
Address Info: https://www.codify.com/contact