Friday, November 27, 2009

Get number of sessions established by every login

Applied to SQL Server 2005 or later

SELECT login_name [Login Name]
, COUNT(session_id) [Session Count]
FROM sys.dm_exec_sessions
GROUP BY login_name

No comments:

Post a Comment

Oracle Query