Saturday 25 June 2016

Get the Query running under a session ID

You can use the below script to get the query executing under session ID


SELECT session_id, command, database_id, user_id, text
FROM sys.dm_exec_requests AS r
CROSS APPLY sys.dm_exec_sql_text(r.sql_handle)
where session_id = 133

No comments:

Post a Comment