Thursday, September 10, 2009

ACTIVE CONNECTIONS FOR EACH DATABASE IN SQL SERVER 2005

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

visit for more http://www.sqldb.in
REJOIN BE A SMART SQLDBA

$1.99 Web Hosting

No comments:

Post a Comment