SELECT ProcessType = ‘Locked Process‘, spid, kpid, a.blocked, dbid, uid, loginame, cpu, login_time, open_tran, STATUS, hostname, program_name, hostprocess, nt_domain, net_address, s1 = a.spid, s2 = 0 FROM master..sysprocesses a JOIN ( SELECT blocked FROM master..sysprocesses GROUP BY blocked ) b ON a.spid = b.blocked WHERE a.blocked = 0
原文:https://www.cnblogs.com/password1/p/14744388.html