Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Nested Triggers Expand / Collapse
Author
Message
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: Wednesday, October 1, 2014 2:30 PM
Points: 515, Visits: 1,138
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...
Post #1370774
Posted Thursday, October 11, 2012 7:43 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, October 16, 2014 3:51 PM
Points: 191, Visits: 899
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.
Post #1371487
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse