Find all related query ids / queries executed for 1 SP

Testing performance of 1 SP which has got quite number of dynamic calls of other SPs, usage of Temp tables, insert, delete operations. I haven't given full detailed study of that SP as it is in use for years and its new to me.

When ran profiler or checked Query Store reports, got to see the SP is split up into various queries and those are captured separately in execution tables or whatsoever.

Now, how to check that particular query belongs to the SP for which I am testing the performance? OR
How to find all the related queries that got captured in Profiler / Query Store for that 1 SP?

Kindly help me.
Thanks in advance.

I have not tried this but looks like this what you are looking for.

1 Like

Almost I got what I needed. I ran it and get to see the script sp_humanevents is working. Will do my reasearch now.

Thank you so much @ahmeds08 !!!

1 Like