0

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

https://learn.microsoft.com/en-us/sql/connect/oledb/features/oledb-driver-for-sql-server-support-for-high-availability-disaster-recovery?view=sql-server-ver16

Or:

MultiSubnetFailover=True

https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/sql/sqlclient-support-for-high-availability-disaster-recovery

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

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.

0
6

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.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.