Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我必须监控 SQL Server 2012 中的阻塞查询。我们如何确定哪些查询是锁定的?我是否使用活动监视器?我想要实际的 SQL 语句。
运行 sp_who2。
您可以向下滚动查看 BlkBy 列的结果。任何具有数字的 SPID 都被 Blkby 列中的 spid 阻止。实际上可以追溯这些,直到您找到原始的阻止程序 SPID。