摘要: select count(spid) as counts, status, hostname, dbname = case when dbid = 0 then null when dbid 0 then db_name(dbid) end from master.dbo.sysprocesses where spid >=0 and spid 0 then db_name(dbid) end... 阅读全文