Get current users and # sessions


/ Published in: SQL
Save to your folder(s)



Copy this code and paste it in your HTML
  1. SELECT login_name, COUNT(session_id) AS [session_count]
  2. FROM sys.dm_exec_sessions
  3. GROUP BY login_name
  4. ORDER BY COUNT(session_id) DESC;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.