Can any one please let me know why we need to create multiple triggers for one event ?

Hi All,

Recently I observed that in one table there are more than 4 triggers are there for after Update event. Can you please let me know why we need to create multiple triggers for one particular event(insert / update / delete) instead of one triggers.

Is there any performance benefits ?

How many triggers can we create on one table ?

what is the max limit to create the triggers for same event(insert / update / delete) ?

Thanks in Advance....

Regards, Satya
more ▼

asked Aug 07 '12 at 06:15 PM in Default

satya gravatar image

361 18 18 21

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

There won't be a performance benefit for multiple triggers, no. In fact, it's a hidden performance cost. Every time you get an UPDATE you'll have four triggers firing. The number of triggers per table is only limited by the number of objects in a database 2,147,483,647.

Remember, the books online is your friend. You can always find this sort of information there: http://msdn.microsoft.com/en-us/library/ms143432.aspx

Personally, I'd be very concerned if I had four triggers on a table. What do they do? Are triggers the right way to get that job done?
more ▼

answered Aug 07 '12 at 07:18 PM

Grant Fritchey gravatar image

Grant Fritchey ♦♦
91k 19 21 74

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Aug 07 '12 at 06:15 PM

Seen: 626 times

Last Updated: Aug 08 '12 at 05:34 AM