I'm trying to find which application is opening various connections on the SQL Server, all named ".net sqlclient data provider".
From system monitor I got the machine name;
On the client with netstat -a -b -o | Find "SQLServer"
, I have found 4 connections all with the PID 4 (ntoskrnl) ...
yes this is windows and it is a MS SQL server.
"Trace process in SQL server profiler", crashes the Management Studio.
So, before I start killing applications, one by one, do you have an idea how to trace back this connection?
Best Regards;
Ezeq
Best Answer
sp_who2
(MSDN) is always a good start, and you can query thesys.processes
table orsys.dm_exec_connections
(MSDN) DMV.Alternatively something like Adam Machanic's
sp_WhoIsActive
can help find problem processes and queries.If you can't find what you're looking for directly in SQL Server, you'll be able to find things like the hostname/IP address and loginame that will help you track down the culprit.
Sample code for querying DMV/sys.processes (you'll have to chop it about if you want to do more):