{"id":57,"date":"2025-05-22T13:12:20","date_gmt":"2025-05-22T11:12:20","guid":{"rendered":"https:\/\/paessens.org\/blog\/?p=57"},"modified":"2025-05-22T13:20:32","modified_gmt":"2025-05-22T11:20:32","slug":"how-do-i-see-active-sql-server-connections","status":"publish","type":"post","link":"https:\/\/paessens.org\/blog\/index.php\/2025\/05\/22\/how-do-i-see-active-sql-server-connections\/","title":{"rendered":"How do I see active SQL Server connections?"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The following SQL Query provide list of active connections.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>SELECT<br>DB_NAME(dbid) as DBName,<br>COUNT(dbid) as NumberOfConnections,<br>loginame as LoginName<br>FROM<br>sys.sysprocesses<br>WHERE<br>dbid > 0<br>GROUP BY<br>dbid, loginame<br>;<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">See also the Microsoft documentation for\u00a0<a href=\"https:\/\/learn.microsoft.com\/en-us\/sql\/relational-databases\/system-compatibility-views\/sys-sysprocesses-transact-sql\">sys.sysprocesses<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The following SQL Query provide list of active connections. SELECTDB_NAME(dbid) as DBName,COUNT(dbid) as NumberOfConnections,loginame as LoginNameFROMsys.sysprocessesWHEREdbid > 0GROUP BYdbid, loginame; See also the Microsoft documentation for\u00a0sys.sysprocesses.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,18],"tags":[19],"class_list":["post-57","post","type-post","status-publish","format-standard","hentry","category-ms-sql","category-mssql_general","tag-ms-sql"],"_links":{"self":[{"href":"https:\/\/paessens.org\/blog\/index.php\/wp-json\/wp\/v2\/posts\/57","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/paessens.org\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/paessens.org\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/paessens.org\/blog\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/paessens.org\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=57"}],"version-history":[{"count":1,"href":"https:\/\/paessens.org\/blog\/index.php\/wp-json\/wp\/v2\/posts\/57\/revisions"}],"predecessor-version":[{"id":58,"href":"https:\/\/paessens.org\/blog\/index.php\/wp-json\/wp\/v2\/posts\/57\/revisions\/58"}],"wp:attachment":[{"href":"https:\/\/paessens.org\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=57"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/paessens.org\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=57"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/paessens.org\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=57"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}