+234 907 428 8984 support@hostbility.com
Affiliate Program 24x7x365 Support

Knowledgebase

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

  • 0


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

  1. Open the SQL server management studio
  2.  
  3. Right-click on the database and click on the execute button.

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.


Was this answer helpful?

« Back

Copyright © 2024 HOSTBILITY. All Rights Reserved.