Monday, October 1, 2012

How to gather the syntax for a current process

Here is a query that I use to get the syntax of a currently running process.  It has allowed me to get the syntax for suspect processes without setting up trace/profiler.   

select text
from sys.dm_exec_sql_text((select sql_handle from
sys.dm_exec_requests where session_id = [session id]))

No comments:

Post a Comment