Posts Tagged ‘how to find out logged users in to a SQL Server 2005’

8
Oct

find out logged users in to a SQL Server 2005

   Posted by: admin   in Sql Server

Hello Guys and Girls what i servers you is some nice thing for sql server users.

if you want to find out the users logged in a database then we have to use some of system views.

sys.sysprocesses is one of them.

select * from sys.sysprocesses;

it will returns the host name , login name , window user name and processes.

if you want to know more stuff of  sys.sysprocesses then go here

http://msdn2.microsoft.com/en-us/library/ms179881.aspx

some more Store procedures provides same stuff

EXEC sp_who

EXEC sp_who2

sp_who provides information about current users, sessions, and processes in an instance of SQL Server.

Enjoy Friends