Saturday, September 27, 2008

Active Connection With SQL Server 2005

Hi

I found This Good One It May Help You

At times, we need to check the number of active connections for each Database on our server. This can be done easily using the following script. The 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


Regards
Mrugank Dholakia
(MCA) Software Engineer

No comments: