0

When I execute

select * from sys.dm_exec_connections

there will be a resulting column connection_id.

Now, I am searching for the connectionstring which corresponds to this connection_id. Can someone help me, where I can find this information?

BennoDual
  • 5,865
  • 15
  • 67
  • 153
  • What specific information do you want to get? I don't think there is connectionstring concept in sql server slide. – qxg Aug 13 '16 at 10:45

1 Answers1

0

You can't find connection string info ,like the way it is deployed in web.config..

To identify and isolate connections,you have to use Application name parameter in connection string

"Data Source =localhost; Initial Catalog=tsql2012;Integrated Security=SSPI;Application Name=testapp";

So whenever application using connection string like above , makes a connection to SQLServer,you can identify it like below..

select program_name,client_net_address from sys.sysprocesses sp
join
sys.dm_exec_connections ec
on ec.session_id=sp.spid
 where program_name='testapp'
TheGameiswar
  • 27,855
  • 8
  • 56
  • 94