Created
June 9, 2014 17:13
-
-
Save rajanand/6ac8abd3acd2a09e1bdd to your computer and use it in GitHub Desktop.
To find the number of active connections for each database in sql server.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--To find the no. of active connections in sql server | |
SELECT db_name(dbid) as database_name, loginame, count(dbid) as no_of_connections | |
FROM sys.sysprocesses | |
WHERE spid > 50 | |
GROUP BY dbid, loginame |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment