Monday, February 23, 2015

How to determine total number of open/active connections in sql server 2008 R2

How to determine total number of open/active connections in sql server 2008 R2

sql code :

SELECT
    DB_NAME(dbid) as DataBase_Names, COUNT(dbid) as total_connections,
    loginame as UserName
FROM
    sys.sysprocesses
WHERE
    dbid > 0
GROUP BY
    dbid, loginame

No comments:

Post a Comment