Best way to find SQL Locks in SQL Server 2008

被刻印的时光 ゝ 提交于 2019-11-30 11:11:20
Remus Rusanu

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.

Carlos

Run this against the master db:

SELECT spid,blocked,program_name,loginame,hostname,lastwaittype,* 
FROM master.dbo.SysProcesses
WHERE blocked <> 0
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!