How to find out what SQL queries are being blocked and what's blocking them?

后端 未结 3 1000
粉色の甜心
粉色の甜心 2021-01-05 12:31

I\'m trying to optimize some slow web pages, and my guess is that the problem has to do with SQL blocking (doesn\'t seem to be a matter of CPU or I/O utilization on the web

3条回答
  •  执笔经年
    2021-01-05 13:07

    SELECT
        p1.SPID AS blockedSPID, p2.SPID AS blockingSPID, ...
    FROM 
        master..sysprocesses p1
        JOIN
        master..sysprocesses p2 ON p1.blocked = p2.spid
    

    Remus: Activity monitor may time out under server load with error 1222

    The MS KB 224453 has a lot of good stuff

提交回复
热议问题