Add support for ALTER COLUMN WITH (ONLINE=ON)
Opened this issue · 1 comments
Is your feature request related to a problem? Please describe.
SQL Server Enterprise Edition and Azure SQL support the concept of "online" schema operations, which perform the operations more slowly but with shorter locking periods. I would like to have the option for sqlpackage
to generate scripts that take advantage of this functionality where possible for ALTER COLUMN
commands.
Describe the solution you'd like
Either when /p:PerformIndexOperationsOnline
or a new parameter is enabled, emit WITH (ONLINE = ON)
when scripting eligible ALTER COLUMN
commands.
Describe alternatives you've considered
A custom deployment contributor that finds eligible operations and updates the SQL before being emitted, similar to the one linked here for index operations.
Additional context
#27 provided support for WITH (ONLINE = ON)
for index operations. Per the documentation, ALTER COLUMN
supports it as well, but enabling /p:PerformIndexOperationsOnline
only enables it for index operations, not ALTER COLUMN
.
This could also be accomplished with the ELEVATE_ONLINE database scoped configuration setting: https://learn.microsoft.com/en-us/sql/t-sql/statements/alter-database-scoped-configuration-transact-sql?view=sql-server-ver16#elevate_online---off--when_supported--fail_unsupported-