Check who all are connected to SQL Server

To check who all are connected to sql server and what they are doing, is a very important requirement. It can be required when you want to perform some exclusive work on you database(s) or for some other work also. In order to check who all are there and connected to which database we can use following stored procedure.

–Check who all connected and doing what
exec sp_who
go

It will give you the following result 

 

Result of store procedure sp_who

Result of store procedure sp_who

About these ads
2 comments
  1. Manas Patnaik said:

    Now how to close those session which are required to

  2. A.Sethi said:

    you can use kill keyword with sid given by the result of that procedure

    for e.g

    kill 56
    go

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: