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


Nested Triggers


Nested Triggers

Author
Message
PiMané
PiMané
SSCertifiable
SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)

Group: General Forum Members
Points: 7115 Visits: 1364
Hi,

Is there any easy way of determining nested triggers?!
For example, if I update a table that has an update trigger and that triggers call and SP the does an insert on another table that has a trigger, is there a way of getting this dependencies?!

Thanks,
Pedro



If you need to work better, try working less...
vikingDBA
vikingDBA
Hall of Fame
Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)

Group: General Forum Members
Points: 3294 Visits: 929
Pedro,

One place to look is the sp_depends procedure.

To use, just call it and give the object name. This is an example for a trigger. (You can look it up in BOL for specifics and other parameters to use.)
EXEC sp_depends @objname = N'AdventureWorks.Production.iWorkOrder' ;


You will have to call it for each object that shows up if you want to follow the trail.

In SSMS, you can right click a table, SPROC, etc. and choose View Dependencies. This gives a hierarchical view of the dependencies.

Hope this gets you started.
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