December 23, 2008 at 10:58 pm
How can we find who all are the users connected in our database??
Plz give me the procedure and navigation.....
December 23, 2008 at 11:22 pm
sp_who2 is the command you want to run and it should provide all the information you need.
David
@SQLTentmaker“He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot
December 24, 2008 at 12:21 am
Thanq david
It shows all the spid inf
But i need only USERS
December 24, 2008 at 12:31 am
Hi,
You may try querying "sysprocesses" table (Master database) and apply filter on the rquired column.
[font="Verdana"]Renuka__[/font]
December 24, 2008 at 10:02 pm
select Login_name from sys.sysprocesses
--To find hostwise connection
select hostname,count(spid) as Total_Connection,sum(isnull(memusage,0)) as MemUsage from sys.sysprocesses
group by hostname
----------
--To find Database wise connection
select db_name(dbid) as DatabaseName,count(spid) as Total_Connection,sum(isnull(memusage,0)) as MemUsage from sys.sysprocesses
group by db_name(dbid)
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply