Home > Software design >  How can I grant a user the option CREATE DATABASE in SQL Server?
How can I grant a user the option CREATE DATABASE in SQL Server?

Time:10-27

I want that a user can create a database, but when I execute this:

GRANT CREATE DATABASE TO rmedrano

I get this error:

CREATE DATABASE permission can only be granted in the master database.

How can I do this?

CodePudding user response:

Members of the dbcreator fixed server role can create, alter, drop, and restore any database.

https://docs.microsoft.com/en-us/sql/relational-databases/security/authentication-access/server-level-roles?redirectedfrom=MSDN&view=sql-server-ver15

  • Related