SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Is trigger a bad solution


Is trigger a bad solution

Author
Message
shohelr2003
shohelr2003
Right there with Babe
Right there with Babe (757 reputation)Right there with Babe (757 reputation)Right there with Babe (757 reputation)Right there with Babe (757 reputation)Right there with Babe (757 reputation)Right there with Babe (757 reputation)Right there with Babe (757 reputation)Right there with Babe (757 reputation)

Group: General Forum Members
Points: 757 Visits: 610
Dear,
I fire triggers on different events. But some of my clients insist on not using trigger. Because they claim that using triggers are the worst solution. It may disable any time. But I don't get any clue.

Please help me.

Regards,
Akbar
GilaMonster
GilaMonster
SSC Guru
SSC Guru (217K reputation)SSC Guru (217K reputation)SSC Guru (217K reputation)SSC Guru (217K reputation)SSC Guru (217K reputation)SSC Guru (217K reputation)SSC Guru (217K reputation)SSC Guru (217K reputation)

Group: General Forum Members
Points: 217273 Visits: 46278
Only time a trigger will be disabled is if someone goes in and disables it.

Triggers shouldn't be the first choice, if a problem can be solved without a trigger then it should be solved without a trigger. Check constraints, foreign keys, etc. If there's no other way than a trigger, then use one and make sure it's written efficiently and correctly to handle multiple rows.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


shohelr2003
shohelr2003
Right there with Babe
Right there with Babe (757 reputation)Right there with Babe (757 reputation)Right there with Babe (757 reputation)Right there with Babe (757 reputation)Right there with Babe (757 reputation)Right there with Babe (757 reputation)Right there with Babe (757 reputation)Right there with Babe (757 reputation)

Group: General Forum Members
Points: 757 Visits: 610
Thank you, it helps me. I got the point.
TheSQLGuru
TheSQLGuru
SSC-Dedicated
SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)

Group: General Forum Members
Points: 31274 Visits: 8670
shohelr2003 (3/11/2013)
Dear,
I fire triggers on different events. But some of my clients insist on not using trigger. Because they claim that using triggers are the worst solution. It may disable any time. But I don't get any clue.

Please help me.

Regards,
Akbar


Use the right tool for the job, and there are definitely situations where a trigger is just that.

As Gail says, be CERTAIN to code the triggers to handle multiple rows in a single DML statement against the base table. THAT IS A CRITICAL FLAW!!!!! I know of more than one company that went out of business because they failed to do that and had bad data processing.

Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search