1 SELECT login_name, 2 program_name, 3 COUNT(0) user_count 4 FROM sys.dm_exec_sessions WITH (NOLOCK) 5 WHERE session_id > 50 6 GROUP BY login_name, 7 program_name 8 ORDER BY user_count DESC
1 SELECT login_name, 2 program_name, 3 COUNT(0) user_count 4 FROM sys.dm_exec_sessions WITH (NOLOCK) 5 WHERE session_id > 50 6 GROUP BY login_name, 7 program_name 8 ORDER BY user_count DESC
转载于:https://www.cnblogs.com/lizhanglong/p/10188142.html