Hello to all.
I am a computer science student and I am currently learning SQL Server. I currently have a free student subscription which gives me access to install a SQL database on Azure.
In order to affiliate myself with the environment, I decided to create two logins and two users (affiliated with these logins) on which I would like to be able to assign them different server-roles, but I am running into a problem.
On this page: server-level-roles, I noticed that we can assign different roles. The one I am interested in is dbcreator (example I am trying to document).
However, when I try to assign dbcreator to my (fictitious) stephanlogin login ;
ALTER SERVER ROLE dbcreator ADD MEMBER stephanlogin;
ALTER SERVER ROLE dbcreator ADD MEMBER stephanuser;
EXEC sp_addrolemember 'dbcreator', 'stephanlogin';
EXEC sp_addrolemember 'dbcreator', 'stephanuser';
I get different errors;
Msg 15151, Level 16, State 1, Line 1
Cannot alter the server role 'dbcreator', because it does not exist or you do not have permission.
Msg 15151, Level 16, State 1, Line 2
Cannot alter the server role 'dbcreator', because it does not exist or you do not have permission.
Msg 15410, Level 11, State 1, Procedure sp_addrolemember, Line 35 [Batch Start Line 0]
User or role 'stephanlogin' does not exist in this database.
Msg 15410, Level 11, State 1, Procedure sp_addrolemember, Line 35 [Batch Start Line 0]
User or role 'stephanuser' does not exist in this database.
My questions are simple :
- How do I assign a role-server on one of my logins (or user)?
- Is there an error in my commands?
- Or, since I'm using Azure SQL Database as a PaaS, I don't have permission to add such server roles to a login? (If so, do you have any Microsoft documentation that states this please).
Thank you for your attention to my request and have a nice day