Blocked Process script for deadlock correction

  • Comments posted to this topic are about the item Blocked Process script for deadlock correction

  • 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

  • I need to implement something like this soon. This article is a few years old so I'm wondering if there are other ideas out there. If not, is there a newer version of this script?

    Many thanks.

  • You can find here the newer one

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply