A dog walked into abutcher shop with a purse strapped around his neck. He walked up to the meat case and calmly queued there until it is his turn to be waited on.
一、查询当前数据库连接数 SELECT
DB_NAME(dbid) as DBName,
COUNT(dbid) as NumberOfConnections,
loginame as LoginName
FROM
sys.sysprocesses
WHERE
dbid > 0
GROUP BY
dbid, loginame