Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sqlpackage publish action permissions issue

I'm running the below sqlpackage command against my sqlserver:

 sqlpackage /action:Publish /SourceFile:"Database Services\bin\Release\Database Services.dacpac" /TargetConnectionString:"Data Source=${Env};Integrated Security=True;Persist Security Info=False;Pooling=False;MultipleActiveResultSets=False;Connect Timeout=60;Encrypt=False;TrustServerCertificate=False;Initial catalog=${Target}"

It contains one predeploy script with one alter. However, I see in the error it tries to alter the whole DB (one level up) instead just doing the alter on the table. any idea why? does it related to some flags I need to add as mentioned here:

https://learn.microsoft.com/en-us/sql/tools/sqlpackage/sqlpackage-publish?view=sql-server-ver15#properties-specific-to-the-publish-action

like image 964
arielma Avatar asked Jul 18 '26 00:07

arielma


1 Answers

I would recommend using /action:Script (see here) to see which actions it will perform, most likely this will give you some clue as to which flags should be set/cleared.

-- Edit According to this old answer you can disable deploying the database properties when designing the .dacpac.
If you want to override this behaviour when publishing the .dacpac, you should probably use the ScriptDatabaseOptions property - see the whole list of switches here.

like image 132
Leon Bouquiet Avatar answered Jul 23 '26 10:07

Leon Bouquiet



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!