Monday, April 24, 2017

SQL - Determining the number of active connections on your SQL server (may be causing SQL to close connections if overloaded)

https://blogs.msdn.microsoft.com/developingfordynamicsgp/2014/04/22/more-on-sql-server-connection-issues-with-microsoft-dynamics-gp/




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:

Post a Comment