SELECT a.spid , a.blocked , lastwaittype = RTRIM( a.lastwaittype ), waitresource = RTRIM( a.waitresource ), a.waittime , a.[dbid] , a.cpu , a.physical_io , a.login_time , a.last_batch , a.ecid , a.open_tran , [status] = RTRIM( a.[status] ), hostname…