0

we have a central database and need to upgrade our local database. We are using dacpac to do this. Basically we make the changes to the database on the server. we then create a dacpac. It gets put into the deployment package. When the client runs the application it checks if theres a new version. If there is, it will upgrade. Problem is we are having. When you make local db changes without dacpac upgrading, it causes a warning that changes have been made other then the dacpac. So when it goes to upgrade the dacpac (done through vb.net code) it completes the process but doesn't actually do any changes. basically skips everything

my code is as followed

If _package.Version <> databaseVersion Then

            dacOptions.ScriptDatabaseOptions = True
            dacOptions.BlockOnPossibleDataLoss = False
            dacOptions.IgnoreIncrement = False
            dacOptions.BlockWhenDriftDetected = False
            dacOptions.RegisterDataTierApplication = True
            dacOptions.IncludeTransactionalScripts = True



            _service.Deploy(_package, localDB, True, dacOptions)

        End If

I noticed if i manually go in SSMS and try to upgrade. it prompts me database has been changed and to click on proceed despite possible data loss. If i do this it will work manually. but by code it still doesn't seem to upgrade even if i have blockonpossibledataloss=false

what can i do to resolve this issue?

Sirus
  • 382
  • 1
  • 8
  • 35

1 Answers1

0

I'd suggest setting RegisterDataTierApplication to false unless you intend to make use of the drift detection functionality.

Steven Green
  • 3,387
  • 14
  • 17