Read-Only application intent using MSOLEDBSQL

Connection string

This Microsoft OLE DB Driver for SQL Server connection string can be used for connections to SQL Server 2019, SQL Server 2017, SQL Server 2016, SQL Server 2014 and SQL Server 2012.

Use a read workload when connecting. Enforces read only at connection time, and also for USE database statements.

Provider=MSOLEDBSQL;Server=tcp:AvailabilityGroupListenerDnsName,1433;
MultiSubnetFailover
=Yes;
ApplicationIntent=ReadOnly;Database=MyDB;
Integrated Security
=SSPI;
Connect Timeout=30;

The result of using ApplicationIntent depends on database configuration. See read-only routing. The default for ApplicationIntent is ReadWrite.