I know how to use SQLpackage.exe. I can export from SQL Azure and create a bacpac. I can also Import to SQL Server via SQLPackage.exe.

I want to export or import without the users in the database. The users are preventing the normal import to fail.

Error importing database :could not import package.

Error SQL72014 Cannot grant, deny or remove permissions to or from special roles enter image description here

I can't delete the users before I export, or exclude them from the import.

Currently we have to backup the database, restore it on SQLAzure, delete the use on this second database, then create a bacpac from the restored database.

How do I get around this? can I use IgnoreUserSettingsObjects with my sqlpackage ? I tried using the parameters but it fails

  • Did you try /P:IgnorePermissions switch? I know in visual studio SSDT you can create a solution and you can delete individual objects from you solution (not in the source) before you deploy. Of course you can only create .dacpac file and do the data separately. – SqlWorldWide Apr 18 '17 at 14:13
  • Thanks, Just tried /P:IgnorePermissions now, but did not work unfortunately. – Peter PitLock Apr 18 '17 at 14:23
  • I will do some test later on and keep you posted. I know for sure SSDT will solve you problem but I do not know how easy it is for you to switch to SSDT from sqlpackage. What role (if you are allowed to share) you are having issue with? – SqlWorldWide Apr 18 '17 at 14:26
  • Thanks @SqlWorldWide, it is a specific user on a different domain that exists in our SQL Azure database, that does not exist on any of the developers databases who want to restore it (not specific role). – Peter PitLock Apr 18 '17 at 14:29
  • so my 2 options are 1) SSDT and 2) dacpac with data afterwards? – Peter PitLock Apr 18 '17 at 14:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.