Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Nested Triggers Expand / Collapse
Posted Wednesday, October 10, 2012 3:02 AM

Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Friday, November 18, 2016 2:29 PM
Points: 592, Visits: 1,330

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?!


If you need to work better, try working less...
Post #1370774
Posted Thursday, October 11, 2012 7:43 AM


Group: General Forum Members
Last Login: Friday, January 29, 2016 12:11 PM
Points: 192, Visits: 929

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.
Post #1371487
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse