On Thu, Sep 9, 2010 at 1:32 PM, David Connors <[email protected]> wrote: > 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 agree on "heavy" use, but I certainly think there is an area of "legitimate" use, no? I often have one or n triggers in any given database (~5 in total?) for little items. And changing it over to a stored-procedure based system just wouldn't be appropriate (IMHO, because it's all handled via the OR/M). I'm pretty sure you'd be happy with general use of them, right? Or flat-out no use at all? > 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. Haha, I think judging from the mood of the list today we can be sure my opinions are typically far from what many would have :P (Of course, I'd generally disagree with that, but when have facts ever matter :P). > -- > 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 -- silky http://dnoondt.wordpress.com/ "Every morning when I wake up, I experience an exquisite joy — the joy of being this signature."
