--- title: "ALTER DATABASE SCOPED CONFIGURATION" description: Enable several database configuration settings at the individual database level. titleSuffix: SQL Server (Transact-SQL) ms.custom: "seo-lt-2019" ms.date: 10/31/2019 ms.prod: sql ms.prod_service: "database-engine, sql-database" ms.reviewer: "" ms.technology: t-sql ms.topic: conceptual 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" ms.assetid: 63373c2f-9a0b-431b-b9d2-6fa35641571a author: "CarlRabeler" ms.author: "carlrab" monikerRange: "= azuresqldb-current || = azuresqldb-mi-current || >= sql-server-2016 || >= sql-server-linux-2017 ||=azure-sqldw-latest|| = sqlallproducts-allversions" --- # ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL) [!INCLUDE[tsql-appliesto-ss2016-asdb-asdw-xxx-md.md](../../includes/tsql-appliesto-ss2016-asdb-asdw-xxx-md.md)] This command enables several database configuration settings at the **individual database** level. Following settings are supported in [!INCLUDE[sssdsfull](../../includes/sssdsfull-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 an arbitrary value (1,2, ...) for the primary database based on what works best for that particular database and set a different value (such as 0) for all secondary database used (such as for reporting queries). - 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 T-SQL 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](../../relational-databases/performance/intelligent-query-processing.md) features. - Enable or disable accelerated plan forcing. - Enable or disable the auto-drop 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 that a paused resumable index operation is paused before it is automatically aborted by the SQL Server engine. - Enable or disable waiting for locks at low priority for asynchronous statistics update This setting is only available in Azure Synapse Analytics (Formerly SQL DW). - Set the compatibility level of a user database ![link icon](../../database-engine/configure-windows/media/topic-link.gif "link icon") [Transact-SQL Syntax Conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md) ## Syntax ```syntaxsql -- Syntax for SQL Server and Azure SQL Database ALTER DATABASE SCOPED CONFIGURATION { { [ FOR SECONDARY] SET } } | CLEAR PROCEDURE_CACHE [plan_handle] | SET < set_options > [;] < set_options > ::= { MAXDOP = { | PRIMARY} | LEGACY_CARDINALITY_ESTIMATION = { ON | OFF | PRIMARY} | PARAMETER_SNIFFING = { ON | OFF | PRIMARY} | QUERY_OPTIMIZER_HOTFIXES = { ON | OFF | PRIMARY} | IDENTITY_CACHE = { ON | OFF } | INTERLEAVED_EXECUTION_TVF = { ON | OFF } | BATCH_MODE_MEMORY_GRANT_FEEDBACK = { ON | OFF } | BATCH_MODE_ADAPTIVE_JOINS = { ON | OFF } | TSQL_SCALAR_UDF_INLINING = { ON | OFF } | ELEVATE_ONLINE = { OFF | WHEN_SUPPORTED | FAIL_UNSUPPORTED } | ELEVATE_RESUMABLE = { OFF | WHEN_SUPPORTED | FAIL_UNSUPPORTED } | OPTIMIZE_FOR_AD_HOC_WORKLOADS = { ON | OFF } | XTP_PROCEDURE_EXECUTION_STATISTICS = { ON | OFF } | XTP_QUERY_EXECUTION_STATISTICS = { ON | OFF } | ROW_MODE_MEMORY_GRANT_FEEDBACK = { ON | OFF } | BATCH_MODE_ON_ROWSTORE = { ON | OFF } | DEFERRED_COMPILATION_TV = { ON | OFF } | ACCELERATED_PLAN_FORCING = { ON | OFF } | GLOBAL_TEMPORARY_TABLE_AUTO_DROP = { ON | OFF } | LIGHTWEIGHT_QUERY_PROFILING = { ON | OFF } | VERBOSE_TRUNCATION_WARNINGS = { ON | OFF } | LAST_QUERY_PLAN_STATS = { ON | OFF } | PAUSED_RESUMABLE_INDEX_ABORT_DURATION_MINUTES =