The MultiSubnetFailover option in database connection strings controls how the client attempts to connect to a database server, especially when multiple IPs are available.
There is conflicting documentation as to whether the correct connection string syntax is:
MultiSubnetFailover=Yes
Or:
MultiSubnetFailover=True
Are both "Yes" and "True" supported? Or does it vary by driver? If the latter, is there a list of which drivers support which syntax?
Update 2023年03月30日:
This Microsoft documentation implies that "True" or "Yes" will work for another option:
The default setting for the Persist Security Info keyword is false. Setting it to true or yes allows security-sensitive information, including the user ID and password, to be obtained from the connection after the connection has been opened. Keep Persist Security Info set to false to ensure that an untrusted source does not have access to sensitive connection string information.
https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/connection-string-syntax
(emphasis added)
2 Answers 2
Connection string keywords are driver/API dependent so the documentation is not conflicting.
The OLE DB Driver for SQL Server IDBInitialize::Initialize connection keywords section:
Possible values are Yes and No.
The OLE DB Driver for SQL Server IDataInitialize::GetDataSource connection keywords section:
Possible values are True and False.
The OLE DB Driver for SQL Server ActiveX Data Objects connection keywords section:
Possible values are True and False.
The System.Data.SqlClient and Microsoft.Data.SqlClient drivers doc:
Possible values are Yes and No, True and False or 1 and 0.
Are both "Yes" and "True" supported? Or does it vary by driver? If the latter, is there a list of which drivers support which syntax?
Every driver has their syntax. In the first link you have, it's for OLEDB, in the second it's for ado.net which can surface either oledb or odbc so you've given different drivers here. There's also SNAC (deprecated) which was a unified front for oledb and odbc, jdbc, tedious, the .net managed ones, etc., so for whatever driver you're using you should look up the syntax and use that.
The SQL Server Native Client (SNAC) has been removed as of SQL Server 2022.
Important
The SQL Server Native Client (often abbreviated SNAC) has been removed from SQL Server 2022 (16.x) and SQL Server Management Studio 19 (SSMS). The SQL Server Native Client (SQLNCLI or SQLNCLI11) and the legacy Microsoft OLE DB Provider for SQL Server (SQLOLEDB) are not recommended for new application development. Switch to the new Microsoft OLE DB Driver (MSOLEDBSQL) for SQL Server or the latest Microsoft ODBC Driver for SQL Server going forward. For SQLNCLI that ships as a component of SQL Server Database engine (versions 2012 through 2019), see this Support Lifecycle exception.
Explore related questions
See similar questions with these tags.