Home > Development, SQL > SQL query to check locking process.

SQL query to check locking process.

Here is a useful query to check user section that cause blocking / locking.

SELECT
d1.session_id,
d3.[text],
d1.login_time,
d1.login_name,
d2.wait_time,
d2.blocking_session_id,
d2.cpu_time,
d1.memory_usage,
d2.total_elapsed_time,
d2.reads,d2.writes,
d2.logical_reads,
d2.sql_handle
FROM sys.dm_exec_sessions d1
JOIN sys.dm_exec_requests d2 ON d1.session_id=d2.session_id
CROSS APPLY sys.dm_exec_sql_text(d2.sql_handle) d3

Categories: Development, SQL Tags: ,
  1. enaken
    July 22nd, 2015 at 05:13 | #1

    Hello! Help me, please. Could you tell me, how to add new field in form syteline. I know for this I need add field to collection, but I don’t know, how to do it… Help me, please(((

  1. No trackbacks yet.
You must be logged in to post a comment.