Friday, June 3, 2016

How to determine total number of open/active connections in SQL Server?

//total number of open/active connections
SELECT
DB_NAME(dbid) as DBName,
COUNT(dbid) as NumberOfConnections,
loginame as LoginName
FROM
sys.sysprocesses
WHERE
dbid > 0
GROUP BY
dbid, loginame

No comments: