Vous êtes ici :
Ce script affiche la liste des sessions actives
Transact-SQL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
/*------------------------------------------------------------------- [SCRIPT] sessions.sql [DATABASE] master [DESCRIPTION] Active sessions [MAJ PAR] DATAFLY - Arian Papillon -------------------------------------------------------------------*/ SELECT spid , status , hostname , program_name , cmd , cpu , physical_io , blocked , sysprocesses.dbid , CONVERT(sysname, RTRIM(loginame)) AS loginname , qt.* , spid AS 'spid_sort' , SUBSTRING(CONVERT(VARCHAR, last_batch, 111), 6, 5) + ' ' + SUBSTRING(CONVERT(VARCHAR, last_batch, 113), 13, 9) AS 'last_batch_char' , request_id FROM sys.sysprocesses WITH ( NOLOCK ) OUTER APPLY sys.dm_exec_sql_text(sysprocesses.sql_handle) AS qt WHERE spid > 50; -- AND program_name LIKE 'xyz%'; -- AND loginame = 'xyz' |
Table of Contents