Tuesday, February 2, 2010

See the number of SQL connections to a database

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

No comments:

Post a Comment