March 15, 2006 at 12:20 am
Could someone help me out on reporting the user connections count per db? If possible I would like the following to also show the dbname from 'sysdatabases'. This way I would get db ID, db name & connections.
SELECT dbid,Count(*)
FROM master..sysprocesses
WHERE spid > 50
group by dbid
Rgds,
March 15, 2006 at 1:56 am
You mean like this?
SELECT p.dbid, d.[name], Count(*)
FROM master..sysprocesses p
JOIN master..sysdatabases d ON d.dbid = p.dbid
WHERE spid > 50
GROUP BY p.dbid, d.[name]
March 15, 2006 at 2:14 am
and also like this ?
SELECT dbid,db_name(dbid),Count(*)
FROM master..sysprocesses
WHERE spid > 50
group by dbid
March 15, 2006 at 2:36 am
Just great! Simpel if you know how to
Thanks Guys!
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply