How to find the number of concurrent SQL Server connections

I have a SQL Server that reaches the maximum limit of concurrent connections. I have many different servers and services that connect to the same SQL Server at the same time.

I found another query that seems to work:

SELECT DB_NAME(dbid) AS DBName, COUNT(dbid) AS NumberOfConnections, loginame AS LoginName, nt_domain AS NT_Domain, nt_username AS NT_UserName, hostname AS HostName FROM sys.sysprocesses WHERE dbid > 0 GROUP BY dbid, hostname, loginame, nt_domain, nt_username ORDER BY NumberOfConnections DESC; 

However, this gives me a number of good connections. How else will I dig this to find, to see each connection and what action do they do?

+6
source share
2 answers

sql command "sp_who", which provides information about current users, sessions and processes in an instance of Microsoft SQL Server Database Engine ( MSDN ) Here you can send results to a temporary table and group them by server name.

for example, the following ...

 CREATE TABLE #tbl ( spid int , ecid int , status varchar(50) , loginame varchar(255) , hostname varchar(255) , blk varchar(50) , dbname varchar(255) , cmd varchar(255) , request_id varchar(255) ) GO INSERT INTO #tbl EXEC sp_who SELECT COUNT(0), hostname FROM #tbl group by hostname DROP TABLE #tbl GO 
+4
source

Are you talking about how to test connections that reach your instance of SQL Server? What about some DOS commands? try to find port 1433 or for the PID of your SQL Server process.

netstat -nao | find "1433"

To find the PID (process identifier) ​​you are looking for, simply go to the task manager and configure the process view, details of the mode are here: http://www.mydigitallife.info/how-to-get-and-view-process-identifier -process-id-or-pid-on-windows /

+2
source

All Articles