I am trying to connect to a SQL 2017 instance via SSMS 18.2 with the 'Additional Connection Parameters'
StatsLog_On=Yes;StatsLogFile=C:\Temp\TestODBC.txt
The documentation at Using Connection String Keywords with SQL Server Native Client is less than perfect, but it strongly implies that it should work. I know from other sources that the keywords StatsLog_On
& StatsLogFile
need to be used together.
I get this error message when I try to connect
===================================
Cannot connect to sandbox.
===================================
Keyword not supported: 'statslog_on'. (System.Data)
Program Location:
at System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey)
at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules)
at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)
at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)
at System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key)
at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
at Microsoft.SqlServer.Management.UI.ConnectionDlg.SqlServerType.Microsoft.SqlServer.Management.UI.ConnectionDlg.IServerType.GetConnectionObject(UIConnectionInfo ci)
at Microsoft.SqlServer.Management.SqlStudio.Explorer.ObjectExplorerService.ValidateConnection(UIConnectionInfo ci, IServerType server)
at Microsoft.SqlServer.Management.UI.ConnectionDlg.Connector.ConnectionThreadUser()
Note: "Sandbpx" is the name of the SQL instance
As a reality check using Server=sandbox;MultiSubnetFailover=True
works fine
Driver
is also not supported (at least in my testing) so maybe this question should be what keywords can I use in the connection string of SSMS? I will look into it more and see what I find. Thanks for you help.(New-Object System.Data.Odbc.OdbcConnection("Driver={SQL Server Native Client 11.0};Server=YourServer;Trusted_Connection=Yes;MultiSubnetFailover=Yes")).Open()