ODBC Driver for SQL Server

Build 25.0.9434

ApplicationIntent

Specifies whether the application intends to access a read-only or read-write version of an availability group database.

Data Type

string

Default Value

"ReadWrite"

Remarks

This property is used in high-availability SQL Server environments that use availability groups, a feature that maintains multiple copies of a database across different servers.

In an availability group:

  • The primary replica is the main server where all changes (read and write operations) are made.
  • Secondary replicas are read-only copies that stay synchronized with the primary.

When ApplicationIntent is set to ReadOnly, the SQL Server listener may route the connection to a read-only secondary replica, if one is available. This can reduce load on the primary server by handling queries that don’t need to update data. If the property is set to ReadWrite, the connection is directed to the primary replica.

This property is useful for improving performance and scalability in environments with high read traffic, especially when availability groups with read-only replicas are configured.

  • Use ReadOnly to offload reporting and analytics queries to a secondary replica.
  • Use ReadWrite (or omit the property) to connect directly to the primary replica for full read/write access.

Additional Information

If the availability group is not configured for read-only routing, setting this property to ReadOnly may result in a failed connection. Always check with your database administrator or deployment configuration.

Copyright (c) 2025 CData Software, Inc. - All rights reserved.
Build 25.0.9434