-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for CREATE INDEX WITH DROP_EXISTING = ON #488
Comments
I think it's always better to do an
|
@jvdslikke DROP_EXISTING is ignored and removed by dacfx in a final script since it converts index changes as drop create, as well as ONLINE which IS the Enterprise feature that we use together. |
Hi @maciejw that's true. But in my opinion it should not even be needed to add DROP_EXISTING in the project SQL files, as this does not belong to the model. It's not about the database design, but how the publish is executed. If an index already exists, it should always be updated with DROP_EXISTING instead of drop-create. To create indexes online you could also use 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- |
Is your feature request related to a problem? Please describe.
We have a very large legacy database that runs on SQL Server Enterprise we would like to use
sqlpackage
out of a box, but its not possible currently because of lack of support of enterprise features such as one mentioned.We cannot drop and create indexes like
dacfx
is doing currently because of performance reasons.Describe the solution you'd like
We would like to be able to use
DROP_EXISTING
feature and instead of script like thiswe would like to get a script like this
It would be perfect if
dacfx
would recognize that we target an enterprise edition, but we see also a solution with a switch in a profile or a parameter, that would forcedacfx
to respects a flag suchDROP_EXISTING
during deployment and emit scripts with it.Describe alternatives you've considered
Currently alternatives are a bit painful, because we could either edit our deployment script by hand (we don't want to do it because of automation) or write and test and
DeploymentPlanModifier
, it requires a lot of effort, we could modify a script this way and during a lot of trial and error figure out all the edge cases we don't know about yet.The text was updated successfully, but these errors were encountered: