|
|
|
SSChasing Mays
      
Group: General Forum Members
Last Login: Friday, October 19, 2012 1:44 PM
Points: 631,
Visits: 230
|
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, June 28, 2012 8:48 AM
Points: 1,
Visits: 13
|
|
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
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Yesterday @ 12:05 PM
Points: 915,
Visits: 168
|
|
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.
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: 2 days ago @ 12:27 PM
Points: 280,
Visits: 1,027
|
|
You can find here the newer one
http://www.sqlservercentral.com/scripts/sp_who2/72823/
Aim to inspire rather than to teach. SQL Server DBA
|
|
|
|