How to see how many connections are open and which usernames to a Microsoft SQL database

SELECT 
    DB_NAME(dbid) as DBName, 
    COUNT(dbid) as NumberOfConnections,
    loginame as LoginName
FROM
    sys.sysprocesses
WHERE 
    dbid > 0
GROUP BY 
    dbid, loginame

Leave a Reply

Your email address will not be published. Required fields are marked *