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
Copy file name to clipboardExpand all lines: docs/relational-databases/performance/query-store-for-secondary-replicas.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,6 +73,9 @@ ALTER DATABASE [Database_Name]
73
73
(OPERATION_MODE = READ_WRITE);
74
74
```
75
75
76
+
> [!NOTE]
77
+
> Before SQL Server Management Studio (SSMS) version 21, the `FOR SECONDARY` syntax is valid but not recognized by IntelliSense. For SQL Server 2022, SSMS IntelliSense does not recognize the `FOR SECONDARY` syntax as valid, but it is valid.
78
+
76
79
### Enable automatic plan correction for secondary replicas
77
80
78
81
**Applies to**: [!INCLUDE [ssSQL22](../../includes/sssql22-md.md)] and later versions, [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)].
Copy file name to clipboardExpand all lines: docs/t-sql/statements/alter-database-transact-sql-set-options.md
+33-1Lines changed: 33 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: Learn how to set database options such as Automatic tuning, encrypt
4
4
author: markingmyname
5
5
ms.author: maghan
6
6
ms.reviewer: randolphwest, wiassaf
7
-
ms.date: 12/10/2025
7
+
ms.date: 02/09/2026
8
8
ms.service: sql
9
9
ms.subservice: t-sql
10
10
ms.topic: reference
@@ -84,6 +84,8 @@ SET
84
84
<option_spec> [ ,...n ] [ WITH <termination> ]
85
85
}
86
86
87
+
{ [ FOR SECONDARY ] SET <set_options> }
88
+
87
89
<option_spec> ::=
88
90
{
89
91
<accelerated_database_recovery>
@@ -342,6 +344,16 @@ The name of the database to be modified.
342
344
343
345
Runs the action in the current database. `CURRENT` isn't supported for all options in all contexts. If `CURRENT` fails, provide the database name.
344
346
347
+
#### FOR SECONDARY
348
+
349
+
**Applies to**: [!INCLUDE [sssql22-md](../../includes/sssql22-md.md)] and later versions
350
+
351
+
Specifies the settings for secondary replicas. All secondary replicas must have the identical values. Similar to `FOR SECONDARY` for [ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL)](alter-database-scoped-configuration-transact-sql.md).
352
+
353
+
For use with the Query Store (`QUERY_STORE`) and Automatic Tuning (`AUTOMATIC_TUNING`) only.
354
+
355
+
Before SQL Server Management Studio (SSMS) version 21, the `FOR SECONDARY` syntax is valid but not recognized by IntelliSense. For SQL Server 2022, SSMS IntelliSense does not recognize the `FOR SECONDARY` syntax as valid, but it is valid.
356
+
345
357
#### \<accelerated_database_recovery> ::=
346
358
347
359
**Applies to**: [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] (Starting with [!INCLUDE[sql-server-2019](../../includes/sssql19-md.md)])
@@ -1809,6 +1821,8 @@ SET
1809
1821
}
1810
1822
;
1811
1823
1824
+
{ [ FOR SECONDARY ] SET <set_options> }
1825
+
1812
1826
<option_spec> ::=
1813
1827
{
1814
1828
<auto_option>
@@ -1957,6 +1971,14 @@ The name of the database to be modified.
1957
1971
1958
1972
Controls automatic options.
1959
1973
1974
+
#### FOR SECONDARY
1975
+
1976
+
Specifies the settings for secondary replicas. All secondary replicas must have the identical values. Similar to `FOR SECONDARY` for [ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL)](alter-database-scoped-configuration-transact-sql.md).
1977
+
1978
+
For use with the Query Store (`QUERY_STORE`) and Automatic Tuning (`AUTOMATIC_TUNING`) only.
1979
+
1980
+
Before SQL Server Management Studio (SSMS) version 21, the `FOR SECONDARY` syntax is valid but not recognized by IntelliSense.
1981
+
1960
1982
#### <aid="auto_create_statistics"></a> AUTO_CREATE_STATISTICS { ON | OFF }
1961
1983
1962
1984
- ON
@@ -2885,6 +2907,8 @@ SET
2885
2907
}
2886
2908
;
2887
2909
2910
+
{ [ FOR SECONDARY ] SET <set_options> }
2911
+
2888
2912
<optionspec> ::=
2889
2913
{
2890
2914
<auto_option>
@@ -3009,6 +3033,14 @@ The name of the database to be modified.
3009
3033
3010
3034
`CURRENT` runs the action in the current database. `CURRENT` isn't supported for all options in all contexts. If `CURRENT` fails, provide the database name.
3011
3035
3036
+
#### FOR SECONDARY
3037
+
3038
+
Specifies the settings for secondary replicas. All secondary replicas must have the identical values. Similar to `FOR SECONDARY` for [ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL)](alter-database-scoped-configuration-transact-sql.md).
3039
+
3040
+
For use with the Query Store (`QUERY_STORE`) and Automatic Tuning (`AUTOMATIC_TUNING`) only.
3041
+
3042
+
Before SQL Server Management Studio (SSMS) version 21, the `FOR SECONDARY` syntax is valid but not recognized by IntelliSense.
0 commit comments