A quick little standalone script that tells you what process is blocking and what processes the blocking processing actually blocking.
When running this script in QA, change your output to "Results in Text" ( CTRL-T ). Utilizes the blocking info in sp_who2 combined with dbcc inputbuffer and a little cursor to wrap it all up. Formatting needs a little work, but the info is all there.
Using Indexes to Bypass Locks
One of the issues you'll face with SQL Server is blocking which is caused by other processes that are holding locks on objects. Until the locks are removed on an object the next process will wait before proceeding. This is a common process that runs within SQL Server to ensure data integrity, but depending on how transactions are run this can cause some issues. Are there ways to get around blocking by using different indexes to cover the queries that may be running?
2008-05-02
3,383 reads