Hi Adi,
I tried that before and got another error message.
DECLARE @Handle binary(20)
select @Handle= sql_handle FROM master.dbo.sysprocesses
SELECT (SELECT TEXT FROM ::fn_get_sql(@Handle)) AS SQL_Command,
loginame, spid, dbid, cpu, physical_io, memusage, last_batch, status, hostname,...