/*List databases and the number of connections to the database.*/SELECTHOSTNAME,DB_NAME(dbid)asDBName,COUNT(dbid)asNumberOfConnections,loginameasLoginNameFROMsys.sysprocessesWHEREdbid>0GROUPBYhostname,dbid,loginame;
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.