0

I have deleted my database in Microsoft SQL Server Management Studio and wanted to recreate it (I did this often in the past) but then I get the error

Msg 262, Level 14, State 1, Line 1

CREATE DATABASE permission denied in database 'master'.

Others who asked this question here got the answer to try running it as admin but I do not have the possibility to do so since my superior (who has the password) is on vacation. Is there any other workaround to create a database? In the past I could create it without admin rights but that was on another server.

Community
  • 1
  • 1
Mad Scientist
  • 857
  • 4
  • 16
  • 43
  • 5
    Simply put; no. If you don't have permission to create databases you can't get around it. If permissions could be avoided, they would be meaningless. They are there for a reason, and work the way they do for a reason. You will need to use a login with high enough permission to create a login. – Thom A Feb 27 '19 at 13:57
  • https://stackoverflow.com/a/44486065/11683? – GSerg Feb 27 '19 at 13:58
  • `often in the past` so what changed? Somehow, someone removed that permission from you. `running it as admin` is meaningless - either you connected using an account that has the `CREATE DATABASE` permission or not. – Panagiotis Kanavos Feb 27 '19 at 14:00
  • Time to call your superior from bahamas. – EzLo Feb 27 '19 at 14:02

1 Answers1

1

In the past I could create it without admin rights but that was on another server.

You should open BOL article CREATE DATABASE and look at the permissions section:

Requires CREATE DATABASE, CREATE ANY DATABASE, or ALTER ANY DATABASE permission.

So you should have any of the above or be a member of db_creator fixed server role. All of the above is inferior respect to sysadmin, maybe "on another server" you was granted any of the above.

If you are local admin on the pc where the server is installed, you always can run it in single user mode and become sysadmin: Connect to SQL Server When System Administrators Are Locked Out

sepupic
  • 8,409
  • 1
  • 9
  • 20