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

Tags:

This entry was posted on Wednesday, October 8th, 2008 at 5:06 am and is filed under Sql Server. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a reply

Name (*)
Mail (will not be published) (*)
URI
Comment