--- title: "ALTER DATABASE SCOPED CONFIGURATION" titleSuffix: SQL Server (Transact-SQL) description: Enable several database configuration settings at the individual database level. author: markingmyname ms.author: maghan ms.reviewer: derekw, bobward, jovanpop, wiassaf, mariyaali, randolphwest ms.date: 01/27/2025 ms.service: sql ms.subservice: t-sql ms.topic: reference ms.custom: - ignite-2025 f1_keywords: - "ALTER_DATABASE_SCOPED_CONFIGURATION" - "ALTER_DATABASE_SCOPED_CONFIGURATION_TSQL" - "DATABASE_SCOPED_CONFIGURATION_TSQL" - "SCOPED_CONFIGURATION_TSQL" - "SCOPED_TSQL" - "ALTER_DATABASE_SCOPED_TSQL" - "DATABASE_SCOPED_TSQL" helpviewer_keywords: - "ALTER DATABASE SCOPED CONFIGURATION statement" - "configuration [SQL Server], ALTER DATABASE SCOPED CONFIGURATION statement" dev_langs: - "TSQL" monikerRange: "=azuresqldb-current || =azuresqldb-mi-current || >=sql-server-2016 || >=sql-server-linux-2017 || =azure-sqldw-latest || =fabric-sqldb" ai-usage: ai-assisted --- # ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL) [!INCLUDE [sqlserver2016-asdb-asdbmi-asa-fabricsqldb](../../includes/applies-to-version/sqlserver2016-asdb-asdbmi-asa-fabricsqldb.md)] Use this command to enable several database configuration settings at the **individual database** level. > [!IMPORTANT] > Different `DATABASE SCOPED CONFIGURATION` options are supported in different versions and platforms of the SQL Database Engine. This article describes **all** `DATABASE SCOPED CONFIGURATION` options. Versions where applicable are noted. Make sure that you use the syntax that's available in the version of service that you're using. The following settings are supported in [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)], [!INCLUDE [fabric-sqldb](../../includes/fabric-sqldb.md)], [!INCLUDE [ssazuremi](../../includes/ssazuremi-md.md)], and in [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] as indicated by the **Applies to** line for each setting in the [Arguments](#arguments) section: - Clear procedure cache. - Set the MAXDOP parameter to a recommended value (1, 2, ...) for the primary database based on what works best for that particular workload, and set a different value for secondary replica databases used by reporting queries. For guidance on choosing a MAXDOP, review [Server configuration: max degree of parallelism](../../database-engine/configure-windows/configure-the-max-degree-of-parallelism-server-configuration-option.md). - Set the query optimizer cardinality estimation model independent of the database to compatibility level. - Enable or disable parameter sniffing at the database level. - Enable or disable query optimization hotfixes at the database level. - Enable or disable the identity cache at the database level. - Enable or disable a compiled plan stub to be stored in cache when a batch is compiled for the first time. - Enable or disable collection of execution statistics for natively compiled [!INCLUDE [tsql](../../includes/tsql-md.md)] modules. - Enable or disable online by default options for DDL statements that support the `ONLINE =` syntax. - Enable or disable resumable by default options for DDL statements that support the `RESUMABLE =` syntax. - Enable or disable [Intelligent query processing in SQL databases](../../relational-databases/performance/intelligent-query-processing.md) features. - Enable or disable accelerated plan forcing. - Enable or disable the autodrop functionality of global temporary tables. - Enable or disable the [lightweight query profiling infrastructure](../../relational-databases/performance/query-profiling-infrastructure.md). - Enable or disable the new `String or binary data would be truncated` error message. - Enable or disable collection of last actual execution plan in [sys.dm_exec_query_plan_stats](../../relational-databases/system-dynamic-management-views/sys-dm-exec-query-plan-stats-transact-sql.md). - Specify the number of minutes a paused resumable index operation is paused before it's automatically aborted by the [!INCLUDE [ssDE-md](../../includes/ssde-md.md)]. - Enable or disable waiting for locks at low priority for asynchronous statistics update. - Enable or disable uploading ledger digests to Azure Blob Storage. - Set the default [full-text index](../../relational-databases/search/full-text-search.md) version (`1` or `2`). - In [!INCLUDE [ssazuresynapse-md](../../includes/ssazuresynapse-md.md)], sets the compatibility level of a user database. :::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: [Transact-SQL syntax conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md) ## Syntax Syntax for [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)], [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)], [!INCLUDE [fabric-sqldb](../../includes/fabric-sqldb.md)], and [!INCLUDE [ssazuremi-md](../../includes/ssazuremi-md.md)]: ```syntaxsql ALTER DATABASE SCOPED CONFIGURATION { { [ FOR SECONDARY ] SET } } | CLEAR PROCEDURE_CACHE [plan_handle] | SET < set_options > [;] < set_options > ::= { ACCELERATED_PLAN_FORCING = { ON | OFF } | ALLOW_STALE_VECTOR_INDEX = { ON | OFF } | ASYNC_STATS_UPDATE_WAIT_AT_LOW_PRIORITY = { ON | OFF } | BATCH_MODE_ADAPTIVE_JOINS = { ON | OFF } | BATCH_MODE_MEMORY_GRANT_FEEDBACK = { ON | OFF } | BATCH_MODE_ON_ROWSTORE = { ON | OFF } | CE_FEEDBACK = { ON | OFF } | DEFERRED_COMPILATION_TV = { ON | OFF } | DOP_FEEDBACK = { ON | OFF } | ELEVATE_ONLINE = { OFF | WHEN_SUPPORTED | FAIL_UNSUPPORTED } | ELEVATE_RESUMABLE = { OFF | WHEN_SUPPORTED | FAIL_UNSUPPORTED } | EXEC_QUERY_STATS_FOR_SCALAR_FUNCTIONS = { ON | OFF } | FORCE_SHOWPLAN_RUNTIME_PARAMETER_COLLECTION = { ON | OFF } | FULLTEXT_INDEX_VERSION = | IDENTITY_CACHE = { ON | OFF } | INTERLEAVED_EXECUTION_TVF = { ON | OFF } | ISOLATE_SECURITY_POLICY_CARDINALITY = { ON | OFF } | GLOBAL_TEMPORARY_TABLE_AUTO_DROP = { ON | OFF } | LAST_QUERY_PLAN_STATS = { ON | OFF } | LEDGER_DIGEST_STORAGE_ENDPOINT = { | OFF } | LEGACY_CARDINALITY_ESTIMATION = { ON | OFF | PRIMARY } | LIGHTWEIGHT_QUERY_PROFILING = { ON | OFF } | MAXDOP = { | PRIMARY } | MEMORY_GRANT_FEEDBACK_PERCENTILE_GRANT = { ON | OFF } | MEMORY_GRANT_FEEDBACK_PERSISTENCE = { ON | OFF } | OPTIMIZE_FOR_AD_HOC_WORKLOADS = { ON | OFF } | OPTIMIZED_PLAN_FORCING = { ON | OFF } | OPTIMIZED_SP_EXECUTESQL = { ON | OFF } | OPTIONAL_PARAMETER_OPTIMIZATION = { ON | OFF } | PARAMETER_SENSITIVE_PLAN_OPTIMIZATION = { ON | OFF } | PARAMETER_SNIFFING = { ON | OFF | PRIMARY } | PAUSED_RESUMABLE_INDEX_ABORT_DURATION_MINUTES =