Sidebar

How to check the supported connections and how many are used per database on SQL Server

0 votes
368 views
asked Jun 10, 2015 by rich-c-2789 (16,180 points)

1 Answer

+1 vote
Here are two queries that will return the results displayed in the screen shot below.  The first will show how many connections are supported by the sql server installation.  The second displays how many connections are used by each database and login.  
 
Note: more doesn't always mean better when trying to increase throughput but, it may help in some cases.
-- Used to determine how many connections are supported by this server
Select @@MAX_CONNECTIONS as SupportedConnections
 
-- Used to list the connections per database and login
SELECT 
    DB_NAME(dbid) as DataBaseName, 
    COUNT(dbid) as NumberOfConnections,
    loginame as LoginName
FROM
    sys.sysprocesses
WHERE 
    dbid > 0
GROUP BY 
    dbid, loginame
 

answered Jun 10, 2015 by rich-c-2789 (16,180 points)
...