Thursday, January 10, 2013

To find out who is connected to database in SQL Server

There are three ways to find who is connected to a database in sqlserver.
First one:
  • Use the SQL SERVER Management Studio -- Management -- Activity Monitor
  • This gives a list of users, database names, status, command, transactions, application with which they are using the database, CPU, IO and Memory usage, Login time etc.

Second One:
  • Use the built in stored procedure called sp_who2
  • Run the command exec sp_who2
  • This gives a list of users, database names, status, command, program with which they are using the database, CPU time, Login time etc.

No comments: