set nocount on;
declare @bufferSPID table (EventType nvarchar(30), Parameter smallint, EventInfo nvarchar(4000));
declare @bufferBLOCKED table (EventType nvarchar(30), Parameter smallint, EventInfo nvarchar(4000));
declare @ret table (spid int, spidEventInfo nvarchar(4000), blocked int, blockedEventInfo nvarchar(4000), hostname...