Tuesday, May 14, 2013

SQL Server: see which users are connected to your database

There are multiple ways to see which users are connected to your SQL Server database. Probably the easiest way is to use the built in stored procedure called sp_who2.

To use it, execute the following steps:

  • Open SQL Server Management Studio
  • Connect to the database server you want to monitor
  • Click on the New Query button to open the SQL editor
  • Paste the sp_who2 command in the SQL Editor

image

  • Click Execute

image

  • In the results window you’ll find a list of logins, database names, status, command, program name, CPU time, Login time and so on.

image

No comments: