How to get the stored procedures that get executed to print in the output

时间:2015-06-30 13:26:33

标签: sql-server stored-procedures

I recently learned that SET STATISTICS IO ON shows what tables get referenced and a lot of useful information. Currently, I'm debugging a stored procedure that branches out and calls a bunch of other stored procedures during the process.

So, my question is: Is there a mechanism similar to STATISTICS IO, which prints out the tables used, that prints out which stored procedures get executed? If so, what is it?

2 个答案:

答案 0 :(得分:3)

It sounds like you simply want to show dependencies where the object type is a Stored Procedure.

Different way to find SQL Dependencies

答案 1 :(得分:2)

If you open up SQL Server Profiler, and run the Stored Procedure, you can get a trace of the nested SP calls. If you've not used it before, do check it out.