日期:2014-05-18 浏览次数:20483 次
select count(*) 当前连接到SQLSERVER的用户数 from dbo.sysprocesses where status <> 'background '
------解决方案--------------------
select * from sys.sysprocesses WHERE nt_domain <>'本机名' AND nt_domain <>'' and net_address<>'' and (nt_username <>'SYSTEM' OR net_library <>'LPC') ORDER BY DBID DESC
------解决方案--------------------
查询连线的进程及其主机名,程序名.
select session_id,[host_name],[program_name] from sys.dm_exec_sessions where is_user_process=1