Basic blocking information

Basic blocking information.

Last updated:

Warning: Review and test in a non-production environment before running.

Back to results

-- Basic blocking information
SELECT
    owt.session_id AS waiting_session_id,
    DB_NAME(tls.resource_database_id) as database_name,
    owt.wait_duration_ms,
    owt.waiting_task_address,
    tls.request_mode,
    tls.request_type,
    tls.resource_associated_entity_id,
    tls.resource_description AS local_resource_description,
    owt.wait_type,
    owt.blocking_session_id,
    owt.resource_description AS blocking_resource_description
FROM sys.dm_os_waiting_tasks AS owt
    INNER JOIN sys.dm_tran_locks AS tls ON owt.resource_address = tls.lock_owner_address
WHERE owt.wait_duration_ms > 5000
    AND owt.session_id > 50