Click here to Skip to main content
15,886,069 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I am getting this error while creating database, I am logged in as Administrator using Windows Authentication.

CREATE DATABASE permission denied in database 'master'. (Microsoft SQL Server, Error: 262)


Cant login as sa user, cant create any user or change user permission.

I am using Microsoft Management Studio 2018 in windows 10. Please help.

What I have tried:

To add Windows user with login “domainname \username”

Using the credentials for the domainname\username account log on to the computer .
Next, follow the path:- Start> All Programs > Microsoft SQL Server >SQL Server Management Studio.
Note: “Run As Administrator” option elevates the user permissions In the User Access Control dialog box, click Continue.
Then, connect to an instance of SQL Server in SQL Server Management Studio .
Next, follow the path >> Security>>right-click Logins>>click New Login.
Enter the user name in the Login name box,.
Finally, Go to Select a page, click Server Roles, select the sysadmin check box, and then click OK.
Posted
Updated 20-Sep-20 2:50am
v2

You do not have SQL user permissions to create a DB: you need to find the administrator of the SQL system you are connecting to, and get them to add the permission - Windows has nothing to do with it, it's your SQL User that requires additional specific permissions.
Even if you log in as a user with all the Windows permissions under the sun on your computer, that doesn't give you any specific rights on SQL; they are completely separate.
 
Share this answer
 
Reference: CREATE DATABASE permission denied in database ‘master’. (Microsoft SQL Server, Error: 262) | Sanal Menon Kalipurayath[^]
Quote:
When a user in the Administrators account runs SQL Server Management Studio, the User Account Control feature strips the membership token for that group and passes only the user account information to SQL Server. A message is returned that states that the account does not have rights to log in to SQL Server. To let members of the Windows Administrators group log in, you must explicitly add the account to the SQL Server logins.

1. To add a Windows user that has the login “machinename\Administrator” to the sysadmin fixed server role
a. Log on to the computer using the credentials for the machinename\Administrator account.
b. Click the Start button, point to All Programs, click Microsoft SQL Server, and then click SQL Server Management Studio.
c. Connect to an instance of SQL Server.
d. Click Security, right-click Logins, and then click New Login.
e. In the Login name box, enter the user name.
f. In the Select a page pane, click Server Roles, select the sysadmin check box, and then click OK.

2. To add a Windows user that has the login “domainname \username” to the sysadmin fixed server role
a. Log on to the computer using the credentials for the domainname\username account.
b. Click the Start button, point to All Programs, click Microsoft SQL Server, right-click SQL Server Management Studio, and then click Run as administrator.
ps: "Run As Administrator" option elevates the user permissions In the User Access Control dialog box, click Continue.
c. In SQL Server Management Studio, connect to an instance of SQL Server.
d. Click Security, right-click Logins, and then click New Login.
e. In the Login name box, enter the user name.
f. In the Select a page pane, click Server Roles, select the sysadmin check box, and then click OK.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900