Best way to find SQL Locks in SQL Server 2008

前端 未结 2 1487
醉梦人生
醉梦人生 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:47

    Run this against the master db:

    SELECT spid,blocked,program_name,loginame,hostname,lastwaittype,* 
    FROM master.dbo.SysProcesses
    WHERE blocked <> 0
    

提交回复
热议问题