Get the number of connections to a database

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

Comments

Popular posts from this blog

Corporate Intranet Information Architecture – a Publishing Site

Deploy and retract a WSP in SharePoint 2007 using Central Admin

Old school kick user with cmd