Skip to content

Instantly share code, notes, and snippets.

@dimaxweb
Created October 8, 2012 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dimaxweb/3851572 to your computer and use it in GitHub Desktop.
Save dimaxweb/3851572 to your computer and use it in GitHub Desktop.
Check number of connections opened against the database - SQL Server 2005
SELECT db_name(dbid) as DatabaseName, count(dbid) as NoOfConnections,
loginame as LoginName
FROM sys.sysprocesses
WHERE dbid > 0
GROUP BY dbid, loginame
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment