I have an Azure SQL database. I would like to allow an Azure AD group named sql-executable
to be the owner of the database structures_db_test
.
So I did the following:
- Created a login in the master and a user also on master both named
sql-executable
. - Then on
structures_db_test
, I ran:
CREATE USER [sql-executable] FROM EXTERNAL PROVIDER;
ALTER ROLE db_owner ADD MEMBER [sql-executable];
But now, when trying to create a new stored procedure I get this error:
Msg 2760, Level 16, State 1, Procedure hello, Line 1 [Batch Start Line 0]
The specified schema name "[my azure upn name]" either does not exist or you do not have permission to use it.
I cannot understand why I get this error when trying to create a stored procedure after doing the above
It is very weird because it is a member of sql-executable
100%
I can run existing stored procedure queries but not creating new ones.
1条答案
按热度按时间xytpbqjk1#
The specified schema name "[my azure upn name]" either does not exist...
You solve this by:
If you want to make your user the owner of the schema:
But they should be able to create objects in that schema anwyay via
db_owner
. Just make sure they always specify the schema in all object references, e.g.: