Brandon
Brandon

Reputation: 745

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

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?

Upvotes: 0

Views: 182

Answers (2)

Chris Walsh
Chris Walsh

Reputation: 3523

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.

Upvotes: 2

sarin
sarin

Reputation: 5307

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

Different way to find SQL Dependencies

Upvotes: 3

Related Questions