use master
create proc sp_who3
as begin
select 'dbcc inputbuffer('+convert(varchar(10),spid)+')' as inputbuffer,waittime/(1000*60) as minutes, *
from(select * from master.dbo.sysprocesses
where blocked > 0
union
select * from master.dbo.sysprocesses
where spid in (select blocked from master.dbo.sysprocesses
where blocked >...