select count(distinct net_address)-1 as 当前连接数 from master..sysprocesses;
select @@CONNECTIONS as 连接或试图连接数,@@MAX_CONNECTIONS as 允许的同时用户连接的最大数;
SELECT COUNT(*) AS 所有进程数 FROM master..sysprocesses;
SELECT cntr_value AS 用户进程数 FROM master..sysperfinfo as p
WHERE p.object_name = 'SQLServer:General Statistics' And p.counter_name = 'User Connections';
exec SP_WHO 'active' ;
SELECT * FROM master..sysprocesses;