Thursday, January 23, 2014

How to get active SQL connections

use below script to get active SQL connections

select
    db_name(dbid) as [Database Name],
    count(dbid) as [No Of Connections],
    loginame as [Login Name]
from
    sys.sysprocesses
where
    dbid > 0
group by
    dbid, loginame

No comments: