February 20, 2009 at 6:37 am
Hi,
Can you tell me if there is counter of the query that will let me check how many users are connected for to database? I know counter SQLServer:General Statistics: User Connections, however that one shows all users connected to the server. I would like to have it split by each data database.
February 20, 2009 at 6:50 am
k.przewozniak (2/20/2009)
Hi,Can you tell me if there is counter of the query that will let me check how many users are connected for to database? I know counter SQLServer:General Statistics: User Connections, however that one shows all users connected to the server. I would like to have it split by each data database.
no, that does not give you the number of users connected to a database it is user connections which is different. You can query sysprocesses table in the masters database, look for loginame and db_id.
February 20, 2009 at 5:49 pm
select spid, status, loginame, hostname, blocked, db_name(dbid), cmd from master..sysprocesses where db_name(dbid) = 'EnterDBName Here'.
HTH!
MJ
February 20, 2009 at 7:37 pm
Did you try
sp_who2
or
SELECT * FROM sys.dm_exec_connections
?
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply