SQL中查询现有未释放连接
SELECT dbid,count(1) FROM [Master].[dbo].[SYSPROCESSES] WHERE spid>50 and status='sleeping' group by dbid order by count(1) desc select * from master.dbo.sysprocesses where spid>50 and waittype = 0x0000 and waittime = 0 and status = 'sleeping' and last_batch < dateadd(minute, -10, getdate()) and login_time < dateadd(minute, -10, getdate())