You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The keyword **ApplicationIntent** can be specified in your connection string. The assignable values are **ReadWrite** or **ReadOnly**. The default is **ReadWrite**.
5
+
6
+
When **ApplicationIntent=ReadOnly**, the client requests a read workload when connecting. The server enforces the intent at connection time, and during a **USE** database statement.
7
+
8
+
The **ApplicationIntent** keyword does not work with legacy read-only databases.
9
+
10
+
11
+
#### Targets of ReadOnly
12
+
13
+
When a connection chooses **ReadOnly**, the connection is assigned to any of the following special configurations that might exist for the database:
- A database can allow or disallow read workloads on the targeted Always On database. This is done with the **ALLOW_CONNECTIONS** clause of the **PRIMARY_ROLE** and **SECONDARY_ROLE** Transact-SQL statements.
If none of those special targets are available, the regular database is read from.
23
+
24
+
25
+
26
+
The **ApplicationIntent** keyword enables *read-only routing*.
27
+
28
+
29
+
## Read-Only Routing
30
+
31
+
Read-only routing is a feature that can ensure the availability of a read only replica of a database. To enable read-only routing:
32
+
33
+
1. You must connect to an Always On Availability Group availability group listener.
34
+
35
+
2. The **ApplicationIntent** connection string keyword must be set to **ReadOnly**.
36
+
37
+
3. The Availability Group must be configured by the database administrator to enable read-only routing.
38
+
39
+
It is possible that multiple connections using read-only routing will not all connect to the same read-only replica. Changes in database synchronization or changes in the server's routing configuration can result in client connections to different read-only replicas. To ensure that all read-only requests connect to the same read-only replica, do not pass an availability group listener to the **Server** connection string keyword. Instead, specify the name of the read-only instance.
40
+
41
+
Read-only routing may take longer than connecting to the primary because read only routing first connects to the primary and then looks for the best available readable secondary. Because of this, you should increase your login timeout.
Copy file name to clipboardExpand all lines: docs/relational-databases/native-client/features/sql-server-native-client-support-for-high-availability-disaster-recovery.md
+1-38Lines changed: 1 addition & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,46 +71,9 @@ ms.workload: "On Demand"
71
71
The driver will return an error if database mirroring is used on the primary database in the availability group, and if **MultiSubnetFailover=Yes** is used in the connection string that connects to a primary database instead of to an availability group listener.
The keyword **ApplicationIntent** can be specified in your connection string. The assignable values are **ReadWrite** or **ReadOnly**. The default is **ReadWrite**.
77
76
78
-
When **ApplicationIntent=ReadOnly**, the client requests a read workload when connecting. The server enforces the intent at connection time, and during a **USE** database statement.
79
-
80
-
The **ApplicationIntent** keyword does not work with legacy read-only databases.
81
-
82
-
83
-
#### Targets of ReadOnly
84
-
85
-
When a connection chooses **ReadOnly**, the connection is assigned to any of the following special configurations that might exist for the database:
- A database can allow or disallow read workloads on the targeted Always On database. This is done with the **ALLOW_CONNECTIONS** clause of the **PRIMARY_ROLE** and **SECONDARY_ROLE**[!INCLUDE[tsql](../../../includes/tsql-md.md)] statements.
If none of those special targets are available, the regular database is read from.
95
-
96
-
97
-
98
-
The **ApplicationIntent** keyword enables *read-only routing*.
99
-
100
-
101
-
## Read-Only Routing
102
-
Read-only routing is a feature that can ensure the availability of a read only replica of a database. To enable read-only routing:
103
-
104
-
1. You must connect to an Always On Availability Group availability group listener.
105
-
106
-
2. The **ApplicationIntent** connection string keyword must be set to **ReadOnly**.
107
-
108
-
3. The Availability Group must be configured by the database administrator to enable read-only routing.
109
-
110
-
It is possible that multiple connections using read-only routing will not all connect to the same read-only replica. Changes in database synchronization or changes in the server's routing configuration can result in client connections to different read-only replicas. To ensure that all read-only requests connect to the same read-only replica, do not pass an availability group listener to the **Server** connection string keyword. Instead, specify the name of the read-only instance.
111
-
112
-
Read-only routing may take longer than connecting to the primary because read only routing first connects to the primary and then looks for the best available readable secondary. Because of this, you should increase your login timeout.
113
-
114
77
## ODBC
115
78
Two ODBC connection string keywords were added to support [!INCLUDE[ssHADR](../../../includes/sshadr-md.md)] in [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] Native Client:
0 commit comments