SQL Server Connections

Here is a handy script to check connections to your SQL Server database.

SELECT db_name(dbid) as DB,
count(dbid) as Connections,
loginame as Login
FROM sys.sysprocesses
WHERE dbid > 0
GROUP BY dbid, loginame
ORDER BY DB