HI all,
Whats the best practice when it comes to deciding what to put into triggers
or SP.
At the moment I find myself putting a lot of stuff into triggers. I have no
idea as to what is generally considered too much for triggers.
Any thoughts
Thanks
RobertRobert
http://www.sql-server-performance.c..._procedures.asp
http://www.sql-server-performance.c...gger_tuning.asp
"Robert Bravery" <me@.u.com> wrote in message
news:OkNr$tpRGHA.4920@.tk2msftngp13.phx.gbl...
> HI all,
> Whats the best practice when it comes to deciding what to put into
> triggers
> or SP.
> At the moment I find myself putting a lot of stuff into triggers. I have
> no
> idea as to what is generally considered too much for triggers.
> Any thoughts
> Thanks
> Robert
>|||Personally, I put as little as possible in the triggers. Use SP if you can.
I use triggers when there is a possibility of accessing data in the table
from a number of different procedures or when I need to be certain
(absolutely) that something will be done when data changes in the table.
MC
"Robert Bravery" <me@.u.com> wrote in message
news:OkNr$tpRGHA.4920@.tk2msftngp13.phx.gbl...
> HI all,
> Whats the best practice when it comes to deciding what to put into
> triggers
> or SP.
> At the moment I find myself putting a lot of stuff into triggers. I have
> no
> idea as to what is generally considered too much for triggers.
> Any thoughts
> Thanks
> Robert
>|||I find triggers are very good to do audit, in other cases SP is preferred.
James
"Robert Bravery" wrote:
> HI all,
> Whats the best practice when it comes to deciding what to put into trigger
s
> or SP.
> At the moment I find myself putting a lot of stuff into triggers. I have n
o
> idea as to what is generally considered too much for triggers.
> Any thoughts
> Thanks
> Robert
>
>|||Triggers are best for enforcing constraints that cannot be enforced
declaratively, or for tracking or reacting to modifications--especially from
multiple sources.
Stored procedures are better for everything else.
"Robert Bravery" <me@.u.com> wrote in message
news:OkNr$tpRGHA.4920@.tk2msftngp13.phx.gbl...
> HI all,
> Whats the best practice when it comes to deciding what to put into
> triggers
> or SP.
> At the moment I find myself putting a lot of stuff into triggers. I have
> no
> idea as to what is generally considered too much for triggers.
> Any thoughts
> Thanks
> Robert
>
No comments:
Post a Comment