Retrieve Number of Open Connections SQL Code

Sources:

title: ## Contents 
style: nestedList # TOC style (nestedList|inlineFirstLevel)
minLevel: 1 # Include headings from the specified level
maxLevel: 4 # Include headings up to the specified level
includeLinks: true # Make headings clickable
debugInConsole: false # Print debug info in Obsidian console

Overview

About

This code will display the number of active connections on a SQL Server Database.

Code

/* NUMBER OF OPEN CONNECTIONS */
SELECT DB_NAME(dbid) as "Database", COUNT(dbid) as "Number Of Open Connections",
loginame as LoginName
FROM sys.sysprocesses
WHERE dbid > 0
GROUP BY dbid, loginame

See Also


Appendix

Note created on 2024-04-30 and last modified on 2024-04-30.

LIST FROM [[SQL - Retrieve Number of Open Connections]] AND -"CHANGELOG" AND -"04-RESOURCES/Code/SQL/SQL - Retrieve Number of Open Connections"

(c) No Clocks, LLC | 2024