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. Please refer to how to connect MsSQL DB using SQL 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,
    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.

Related Articles

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

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

Fix :: Reporting Service Error After Upgrade From MS SQL server from 2008 to 2012

Error Message Throwing Microsoft.ReportingServices.Diagnostics.Utilities....

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...

How to Verify MSSQL Server Edition?

Please refer to the following steps to verify the exact MSSQL edition. We have prepared these...

  • 0 Users Found This Useful

Was this answer helpful?