Skip to main content Microsoft Intelligent Data Platform Azure Arc Azure databases Power BI SQL Server 2025 SQL Server BI SQL Server 2022 SQL Server 2019 SQL Server 2017 SQL Server 2016 SQL Server 2005 - 2014 Downloads Community SQL End of Support Data Security - SQL Server Encryption SQL Server blog SQL Server and Azure SQL workshops Browse Microsoft Solutions Hub SQL Server Tech Community Azure Databases Tech Community Azure Synapse Analytics Tech Community Developer Find a partner Become a partner Partner resources Try SQL Server 2025 Microsoft Security Azure Dynamics 365 Microsoft 365 Microsoft Teams Windows 365 Microsoft AI Azure Space Mixed reality Microsoft HoloLens Microsoft Viva Quantum computing Sustainability Education Automotive Financial services Government Healthcare Manufacturing Retail Find a partner Become a partner Partner Network Microsoft Marketplace Marketplace Rewards Software development companies Blog Microsoft Advertising Developer Center Documentation Events Licensing Microsoft Learn Microsoft Research View Sitemap
·
2 min read

Database scoped default online options is in preview for Azure SQL DB

This post is authored by Mirek Sztajno, Senior Program Manager, Azure SQL Database.

We are happy to announce that database scoped default options for online and resumable are now available for public preview. With this feature, you can set a default behavior for online and resumable rather than defining the option for each individual statement.

You can also avoid accidentally performing an operation that locks your table. By setting online as the default for your database, you can ensure that every supported operation will be elevated to online. You can override these set defaults by defining an option for online or resumable in the statement.

Users can set these defaults using the ELEVATE_ONLINE and ELEVATE_RESUMABLE database scoped configuration options. Both options will cause the engine to automatically elevate supported operations to online or resumable execution. You can enable the following behaviors using these options:

  • You can set either option to FAIL_UNSUPPORTED if you would like to execute all operations online or resumable and fail operations that are not supported for online or resumable.
  • You can set either option to WHEN_SUPPPORTED if you would like to execute supported operations online or resumable and run unsupported operations offline or nonresumable. You can set either option to OFF to maintain the current behavior of executing all operations offline and nonresumable unless explicitly specified in the statement.
  • You can set either option to OFF to maintain the current behavior of executing all operations offline and nonresumable unless explicitly specified in the statement.

Note: The user can override the default setting by submitting a statement with the ONLINE option specified.

Examples:

--Set Defaults to FAIL_UNSUPPORTED

ALTER DATABASE SCOPED CONFIGURATION SET ELEVATE_ONLINE = FAIL_UNSUPPORTED;

ALTER DATABASE SCOPED CONFIGURATION SET ELEVATE_RESUMABLE = FAIL_UNSUPPORTED;
--Rebuild Supported Index

ALTER INDEX index1 on Table1

Rebuild;

--Result: The rebuild will execute as normal
--Rebuild Unsupported Index

ALTER INDEX columnstoreindex1 on Table1

Rebuild;

--Result: The rebuild will fail and an error message will be displayed in the log
--Set Defaults to WHEN_SUPPORTED

ALTER DATABASE SCOPED CONFIGURATION SET ELEVATE_ONLINE = WHEN_SUPPORTED;

ALTER DATABASE SCOPED CONFIGURATION SET ELEVATE_RESUMABLE = WHEN_SUPPORTED;
--Rebuild Supported Index

ALTER INDEX index1 on Table1

Rebuild;

--Result: The rebuild will execute as normal
--Rebuild Unsupported Index

ALTER INDEX columnstoreindex1 on Table1

Rebuild;

--Result: The rebuild will execute nonresumably, a warning will be displayed in the log

 

For more information about Database Scoped Default Online and Resumable Options please review:

English (United States)
Your Privacy Choices Opt-Out Icon Your Privacy Choices
Consumer Health Privacy Sitemap Contact Microsoft Privacy Manage cookies Terms of use Trademarks Safety & eco Recycling About our ads