skip to Main Content

I have a sqlproj XML for Azure SQL Database. I want to deploy database with several tables into specific schema which is also created using this build. How to specify what user should be used for CREATE SCHEMA [schema-name] AUTHORIZATION [user] ? By default it uses user dbo but I need to change it. How to specify it in the sqlproj?

2

Answers


  1. Chosen as BEST ANSWER

    It appeared the user (service principal) trying to deploy the solution to SQL Database was not set as an AAD admin on the SQL server. It seems a little bit strange to me, but it worked.


  2. Sounds like you are looking in a wrong place. All database schema definitions in SSDT, by default, are placed into the Security folder. In it, you will have your schema-name.sql file, and there you can adjust the authorization clause.

    For the project to build, the owner of that schema should also be present in the project. Most likely, you will find it in the same folder.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search