Overblog Follow this blog
Edit post Administration Create my blog
Balavardhan Reddy Narani

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

Repost 0

Comment on this post