--执行系统存储过程,查询登录名为sa的并发数,如果不指定登录名,则查询全部
exec SP_WHO 'sa'
--查询master.dbo.sysprocesses表,其实SP_WHO存储过程也是封装了该表
select hostname,count(*) AS Count from master.dbo.sysprocesses group by hostname order by count(*) desc
转载于:https://www.cnblogs.com/ToughGuy/p/4756990.html