Overblog
Edit post Follow this blog Administration + Create my blog

How to check the active connections for each Database in SQL Server 2005

August 6 2009 , Written by Balavardhan Reddy Published on #SQL Server2005


We need to check the number of active connections for a Database on our server.

We can get that details by using the following SQL script. This SQL script displays the DatabaseName, the number of connections and the login name :

SELECT db_name(dbid) as DatabaseName, count(dbid) as NoOfConnections,
loginame as LoginName
FROM sys.sysprocesses
WHERE dbid > 0
GROUP BY dbid, loginame

---
Share this post
Repost0
To be informed of the latest articles, subscribe:
Comment on this post