Thursday 16 June 2011

How to find blocking in SQL Server ?

      Blocking:

·         The following query is used to determine the blocking sessions:
select blocking_session_id, wait_duration_ms, session_id from
sys.dm_os_waiting_tasks
where blocking_session_id is not null

·         The following query is used to identify the query is executed currently for blocking:
dbcc INPUTBUFFER(session_id)

·         The following query is used to find out the spid that is blocking another spid:
Sp_who

No comments:

Post a Comment