x
login about faq Site discussion (meta-askssc)

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

satya
351 10 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 ♦♦
62.2k 12 20 66

(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.

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x220
x98

asked: Aug 07 '12 at 06:15 PM

Seen: 307 times

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

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.