How to check active connections on your MS-SQL Database ?

To check active database connection in the MS SQL server please follow the below steps.

  1. Open the SQL server management studio.

  2. Right-click on the database and click on the execute button.

  3. Now, run the below select query to find our active connection on your database. Here, you need to add your database name instead of DB NAME.

    SELECT DB_NAME(dbid) AS DBName,
    COUNT(dbid) AS NumberOfConnections,
    loginame
    FROM    sys.sysprocesses
    GROUP BY dbid, loginame
    ORDER BY DB_NAME(dbid)
    

You will see the result similar to below screen capture, it will show all the active database connection on your SQL server.

To check the active sessions/connection in the SQL server execute the below query in the SQL server management studio.

 

exec sp_who

 

The above query will show all the active users and sessions connected to the SQL server.

  • 0 Users Found This Useful

Was this answer helpful?

Related Articles

How to take MSSQL database offline or bring it online?

Sometimes, you come across to a situations when you are required to physically move the database...

How to install SQL Server Reporting Service (SSRS) on MSSQL 2014 Express Edition?

SQL Server Reporting Services is used for creating, publishing, and managing reports, and...

Fix : Server Unable to load user-specified certificate. The server will not accept a connection

You may encounter this error when you attempt to start the MSSQL service. This error occurs when...

How to use MSSQL Activity Monitor to find the most expensive query?

A slow and long running SQL query execution consumes much processor, memory, and disk of your...

How do I connect to MSSQL Server 2008 from SQL Server Management Studio?

This article will guide you on how to connect to MS SQL Server 2008 from SQL Server Management...