I am trying to get the information about the running queries for query performance monitoring purpose.
Is there a way to get the location of the running query in SQL-server?
For instance, if I have a stored procedure running in a server and if I'm getting all the activity monitoring data for the running query, I want to fetch the path of the stored procedure in which the query is running.
Is there a query to do this or any other way to get this path?
Example Path/hierarchy : sever/db/stored_procedure_name/query
Best Answer
I would use sp_whoisactive with
@get_full_inner_text
and@get_outer_command
: