How to grant sysadmin permissions to user in Azure SQL Database or how to give same level of access to a user in Azure SQL Database?
Use the azure portal. server-level principal login should be used to grant access to individual databases.
One can create new user & give rights to one or more databases:
-- in master
create login [XXXX] with password = 'YYYYY'
create user [XXXX] from login [XXXX];
-- if you want the user to be able to create databases and logins
exec sp_addRoleMember 'dbmanager', 'XXXX';
exec sp_addRoleMember 'loginmanager', 'XXXX'
-- in each individual database, to grant dbo
create user [XXXX] from login [XXXX];
exec sp_addRoleMember 'db_owner', 'XXXX';
If you just created a login and a corresponding user, you have to add the appropriate role memberships...
e.g.,
exec sp_addrolemember 'dbmanager', 'login1User';
exec sp_addrolemember 'loginmanager', 'login1User';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With