• I don't understand how the last_batch for the blocker corresponds to someone waiting for a blocker. If you are getting the blocking spid record how is his last_batch value related to those being blocked?

    -- get the blocking spid

    SELECT @spid = spid, @hostname = hostname FROM master.dbo.sysprocesses

    -- %%% Adjust > 120 to the number of seconds a processes has been blocked

    -- before loging the data, notifying, and killing the Blocking process

    WHERE blocked = 0 AND (convert(money,getdate()-last_batch)* 86400.0) > 120