About this question
I am making a database in sql server and it shows an error that "CREATE DATABASE permission denied in database 'master'" I am using the administrator log in itself. What do I need to do? Please suggest a fix!
I am making a database in sql server and it shows an error that "CREATE DATABASE permission denied in database 'master'" I am using the administrator log in itself. What do I need to do? Please suggest a fix!
Log in to share your answer and help other learners.
Log in to answerBest Answer · By JanBask MS SQL Server Expert
Answered on Sep 29, 2022
In case of - create database permission denied in database master - The user must be a member of the dbcreator server role for the user to have enough permissions to create a database. You can execute the following statement to make a user member of the dbcreator server role.
EXEC master..sp_addsrvrolemember @loginame = N'Shubhankar', @rolename = N'dbcreator'GO Or you Can/Should use
ALTER SERVER ROLE [dbcreator] ADD MEMBER [Shubhankar];GO
Members of sysadmin role are by default members of dbcreator server role therefore they can create databases too.
Ranjana Admin JanBask Expert Latest answer
Answered on Jun 7, 2024
If you receive the error "CREATE DATABASE permission denied in database 'master'", it means that your user account does not have the necessary permissions to create a new database. Here are the steps to resolve this issue:
1. Check Your Permissions
First, confirm that your user account does not have the required permissions:
USE master;
SELECT * FROM sys.database_permissions WHERE grantee_principal_id = DATABASE_PRINCIPAL_ID('YourUserName');
2. Contact the Database Administrator (DBA)
If you don't have the necessary permissions, you'll need to contact your DBA or the person responsible for managing database permissions. Request that they grant you the required permissions to create databases.
3. Granting Permissions
If you have access to an account with sufficient privileges (such as a sysadmin or a user with the dbcreator role), you can grant the necessary permissions to your user account.
Option 1: Grant the dbcreator Role
The dbcreator role allows a user to create, alter, drop, and restore databases.
USE master;ALTER SERVER ROLE dbcreator ADD MEMBER [YourUserName];Option 2: Grant Specific Permissions
Alternatively, you can grant specific permissions to create a database:
USE master;
GRANT CREATE ANY DATABASE TO [YourUserName];4. Verify Permissions
After granting the permissions, verify that the user has the correct permissions:
USE master;SELECT * FROM sys.database_permissions WHERE grantee_principal_id = DATABASE_PRINCIPAL_ID('YourUserName');Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.
Step-by-step SQL Server guides from industry experts
Common SQL Server interview questions, answered
Guides, tips and career advice on SQL Server from JanBask experts.
SQL Server Top 75 SSAS Interview Questions and Answers For Beginners & Experts
Prepare for your SSAS interview with our comprehensive guide featuring 75 top SQL Server Analysis Services interview questions…
SQL Server How to Become a SQL Database Administrator?
How to become a sql database administrator In 2025, discover what these professionals do, explore how much they earn and learn…
SQL Server OLAP vs OLTP: Key Differences, Architectures, Performance & Real-World Examples
Compare OLTP vs OLAP with clear definitions, architecture diagrams, real-world examples, and FAQs. Learn when to use each system…
SQL Server 70+ Most Asked SSIS Interview Questions for Freshers & Experienced
Prepare for your next SQL Server Integration Services (SSIS) interview with our top 70+ SSIS interview questions and answers.…