Best way to find SQL Locks in SQL Server 2008

前端 未结 2 1489
醉梦人生
醉梦人生 2021-01-01 16:16

What is the best way to find the SQL locks along wih the user associated with that lock in SQL Server 2008?

2条回答
  •  礼貌的吻别
    2021-01-01 16:45

    select * from sys.dm_tran_locks will list all current locks, granted or pending, along with the requesting session id. select * from sys.dm_exec_sessions will list all current sessions, including the client host and login name. But going this way is very seldom what you want. For a more digestible form, use the Activity Monitor and watch the blocking as reported there.

提交回复
热议问题