Skip to content

Commit 58bdbe7

Browse files
authored
Merge pull request #16756 from pmasl/patch-867
Update alter-database-transact-sql-set-options.md
2 parents 2b66688 + ecb6903 commit 58bdbe7

1 file changed

Lines changed: 17 additions & 12 deletions

File tree

docs/t-sql/statements/alter-database-transact-sql-set-options.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,13 @@ SET
188188
| TRANSFORM_NOISE_WORDS = { OFF | ON }
189189
| TWO_DIGIT_YEAR_CUTOFF = { 1753, ..., 2049, ..., 9999 }
190190
}
191+
191192
<FILESTREAM_option> ::=
192193
{
193194
NON_TRANSACTED_ACCESS = { OFF | READ_ONLY | FULL
194195
| DIRECTORY_NAME = <directory_name>
195196
}
197+
196198
<HADR_options> ::=
197199
ALTER DATABASE SET HADR
198200
@@ -206,7 +208,7 @@ SET
206208
{
207209
QUERY_STORE
208210
{
209-
= OFF
211+
= OFF [ FORCED ]
210212
| = ON [ ( <query_store_option_list> [,...n] ) ]
211213
| ( < query_store_option_list> [,...n] )
212214
| CLEAR [ ALL ]
@@ -229,7 +231,7 @@ SET
229231
230232
<query_capture_policy_option_list> :: =
231233
{
232-
STALE_CAPTURE_POLICY_THRESHOLD = number { DAYS | HOURS }
234+
STALE_CAPTURE_POLICY_THRESHOLD = number { DAYS | HOURS }
233235
| EXECUTION_COUNT = number
234236
| TOTAL_COMPILE_CPU_TIME_MS = number
235237
| TOTAL_EXECUTION_CPU_TIME_MS = number
@@ -247,11 +249,12 @@ SET
247249
REMOTE_DATA_ARCHIVE =
248250
{
249251
ON ( SERVER = <server_name> ,
250-
{CREDENTIAL = <db_scoped_credential_name>
251-
| FEDERATED_SERVICE_ACCOUNT = ON | OFF
252-
}
253-
)
254-
| OFF
252+
{
253+
CREDENTIAL = <db_scoped_credential_name>
254+
| FEDERATED_SERVICE_ACCOUNT = ON | OFF
255+
}
256+
)
257+
| OFF
255258
}
256259
}
257260
@@ -267,8 +270,8 @@ SET
267270
<snapshot_option> ::=
268271
{
269272
ALLOW_SNAPSHOT_ISOLATION { ON | OFF }
270-
| READ_COMMITTED_SNAPSHOT {ON | OFF }
271-
| MEMORY_OPTIMIZED_ELEVATE_TO_SNAPSHOT = {ON | OFF }
273+
| READ_COMMITTED_SNAPSHOT { ON | OFF }
274+
| MEMORY_OPTIMIZED_ELEVATE_TO_SNAPSHOT = { ON | OFF }
272275
}
273276
<sql_option> ::=
274277
{
@@ -293,7 +296,9 @@ SET
293296
| ROLLBACK IMMEDIATE
294297
| NO_WAIT
295298
}
296-
<temporal_history_retention>::=TEMPORAL_HISTORY_RETENTION { ON | OFF }
299+
300+
<temporal_history_retention> ::=
301+
TEMPORAL_HISTORY_RETENTION { ON | OFF }
297302
```
298303

299304
## Arguments
@@ -331,9 +336,9 @@ The AUTO_CLOSE option is useful for desktop databases because it allows for data
331336
>
332337
> When AUTO_CLOSE is set to ON, some columns in the [sys.databases](../../relational-databases/system-catalog-views/sys-databases-transact-sql.md) catalog view and the [DATABASEPROPERTYEX](../../t-sql/functions/databasepropertyex-transact-sql.md) function will return NULL because the database is unavailable to retrieve the data. To resolve this issue, run a USE statement to open the database.
333338
>
334-
> Database mirroring requires AUTO_CLOSE OFF.
339+
> Database mirroring requires AUTO_CLOSE set to OFF.
335340
336-
When the database is set to AUTOCLOSE = ON, an operation that initiates an automatic database shutdown clears the plan cache for the instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. Clearing the plan cache causes a recompilation of all subsequent execution plans and can cause a sudden, temporary decrease in query performance. Starting with [!INCLUDE[ssVersion2005](../../includes/ssversion2005-md.md)] Service Pack 2, for each cleared cache store in the plan cache, the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] error log contains the following informational message: `SQL Server has encountered %d occurrence(s) of cachestore flush for the '%s' cachestore (part of plan cache) due to some database maintenance or reconfigure operations`. This message is logged every five minutes as long as the cache is flushed within that time interval.
341+
When the database is set to `AUTOCLOSE = ON`, an operation that initiates an automatic database shutdown clears the plan cache for the instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. Clearing the plan cache causes a recompilation of all subsequent execution plans and can cause a sudden, temporary decrease in query performance. Starting with [!INCLUDE[ssVersion2005](../../includes/ssversion2005-md.md)] Service Pack 2, for each cleared cache store in the plan cache, the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] error log contains the following informational message: `SQL Server has encountered %d occurrence(s) of cachestore flush for the '%s' cachestore (part of plan cache) due to some database maintenance or reconfigure operations`. This message is logged every five minutes as long as the cache is flushed within that time interval.
337342

338343
<a name="auto_create_statistics"></a> AUTO_CREATE_STATISTICS { **ON** | OFF }
339344
ON

0 commit comments

Comments
 (0)