Give the dbcreator, public, and Bulkadmin roles to a SQL Server user on RDS

0

I have created a new SQL user on an RDS (Not custom) database with :

`USE master; GO

CREATE LOGIN my_user WITH PASSWORD = 'my_password'; GO`

And now I want to assign roles to them (dbcreator, public, and Bulkadmin roles).

I tried using EXEC sp_addrolemember 'dbcreator', 'my_user';

but I received an error message saying 'User or role 'my_user' does not exist in this database'.

How can i resolve this ?

m-mas
asked a year ago1355 views
2 Answers
1

As documented bulkadmin and dbcreator server roles are not supported in Amazon RDS for SQL Server.

To give permissions to a new user to create databases you can execute

GRANT CREATE ANY DATABASE TO [my_user];

The user will become database owner for any new database they are creating and will be able to drop the database.

To allow the user to delete backup history on drop, you need to grant permissions on sp_delete_database_backuphistory.

USE [msdb]
CREATE USER [my_user] FOR LOGIN [my_user] WITH DEFAULT_SCHEMA=[dbo]
GO
GRANT EXECUTE ON [dbo].[sp_delete_database_backuphistory] TO [my_user]

Hope this helps.

AWS
answered a year ago
0

Thanks for your help !

Is it possible to have an alternative and create an RDS database with default language = French instead of having English as the default language?

m-mas
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions