I know there was a similar question before at SO as shown here However, that answer really does not address my question. So here is my scenario, and I will demo it with PowerShell.
The following code will create two sessions on my local sql2016 instance
#The only difference in the two connection strings is [pooling] property, the $connstr_1 has pooling=true, while the $connstr_2 has pooling=false. $connstr_1 = "data source=localhost\sql2016; initial catalog=master; trusted_connection=true; app=ConnPoolTest; pooling=true"; $SqlConnection1 = New-Object System.Data.SqlClient.SqlConnection($connstr_1) $connstr_2 = "data source=localhost\sql2016; initial catalog=master; trusted_connection=true; app=ConnPoolTest; pooling=false"; $SqlConnection2 = New-Object System.Data.SqlClient.SqlConnection($connstr_2) $SqlConnection1.Open() $SqlConnection2.Open();
My question is on sql server side, how can I know which session's connection string has pooling property set to
true and which set to