Identify waiting SPIDs and reasons for wait

SELECT wt.session_id, ot.task_state, wt.wait_type, wt.wait_duration_ms/60000,
wt.blocking_session_id, wt.resource_description, es.[host_name], es.[program_name]
FROM sys.dm_os_waiting_tasks wt INNER JOIN sys.dm_os_tasks ot ON
ot.task_address = wt.waiting_task_address INNER JOIN
sys.dm_exec_sessions es ON es.session_id = wt.session_id WHERE
es.is_user_process = 1
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s