|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 5:32 AM
Points: 124,
Visits: 324
|
|
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
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 6:22 AM
Points: 37,736,
Visits: 30,007
|
|
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 2008, MVP 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
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 5:32 AM
Points: 124,
Visits: 324
|
|
| Thank you, it helps me. I got the point.
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Yesterday @ 6:58 PM
Points: 3,581,
Visits: 5,125
|
|
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 at GMail
|
|
|
|