SELECT datediff(mi,last_batch,getdate())LockTime,P.SPID, P.BLOCKED BLOCKEDBY, RTRIM(P.HOSTNAME) HOSTNAME,sql_handle
FROM MASTER..SYSPROCESSES P
WHERE P.BLOCKED <> 0
AND SPID<>BLOCKED
OR SPID IN (SELECT BLOCKED FROM MASTER..SYSPROCESSES)
AND BLOCKED IN (SELECT SPID FROM MASTER..SYSPROCESSES)
AND BLOCKED=0
ORDER BY P.BLOCKED, P.SPID
Wednesday, 16 May 2007
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment