Pages

Tuesday, November 3, 2009

Currently running query and kill query session_id

Query to see which query is running
-------------------------------------
select sqltext.text,req.session_id,req.blocking_session_id,req.status,req.command,req.cpu_time,req.total_elapsed_time
from master.sys.dm_exec_requests req cross apply master.sys.dm_exec_sql_text(sql_handle) as sqltext

kill(session_id)

No comments:

Post a Comment