Can I create indexes with ONLINE option set to ON using SSDT publish? If I add such definition to the index publish is simply ignoring that setting. SQL Server 2017 Enterprise
Update
For SqlPackage versions 162.2 or greater apparently this issue is now resolved and it will now take account of the ONLINE=ON/OFF
keyword in index definitions.
And moreover provides a new command line property (PerformIndexOperationsOnline
) to supply a default for cases where this is not set explicitly.
Original Answer (previous versions)
Annoyingly SSDT ignores this property.
If you are on a version of SQL Server that supports the ELEVATE_ONLINE
database scoped configuration you can use this to ensure that all such operations happen online (SQL Server 2017 Enterprise is not such an edition, currently this is a preview option in Azure only).
Alternatively you can set your deployment pipeline up to run a "pre model" phase that can include custom scripts to create the index if needed with desired options before the SSDT diff is generated.
To achieve this entirely within SSDT you would need to use a deploy contributor. For this option an example project you may well find highly relevant is EditionAwareCreateIndex