• This code is not working:AND @@spid(error on this), but that is ok I understand.Thank you

    SELECT spid

    FROM Master.dbo.sysprocesses

    WHERE DBID NOT IN (1,2,3,4) -- Master, Tempdb, Model, MSDB

    AND spid > 50

    AND @@spid

    ORDER BY spid DESC