Monday, July 27, 2009

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

To those of you who have Microsoft SQL Server Management Studio, and you’re un-hardcore users like myself who simply want to create a simple database to play around with, you might run into this cryptic error when you try to create a new database. 


Naturally the help URL link provided merely consoles you with an all-too-common “sorry, we can’t help” message.

We're sorry

There is no additional information about this issue in the Error and Event Log Messages or Knowledge Base databases at this time. You can use the links in the Support area to determine whether any additional information might be available elsewhere.

Given that you’re not a hardcore MS SQL Server user, and neither am I, this error makes little sense.  There’s a system database called master, but I’m not creating that… I’m creating my own database, called ‘MyDatabase’.  I don’t care about the permissions to the database called ‘master.’  Further, I’m the admin on my PC, and I’m using “Windows Authentication”… to me that sounds like I should have the highest possible access to do whatever the heck I want with my local SQL server. 

Well, yeah, you do, but here’s the catch: You have to run the damn SQL Management Studio as administrator.  That’ll make this hellish error go away.  I sincerely hope that this blog post has saved at least one person from the frustration they might otherwise endure.


Unknown said...

I get this error when i try to restore an old database. Even running MgtStudio as administrator wont do it :|

Dan said...

Yes,It worked for me, when I logged on as Administrator.
Thank you very much.

Unknown said...

Yeah, man it helps me a lot!
Great work, Thanks!

nido said...

I ma getting this error even I run Sql Management studio as administrator, should I create another account name as Administrator for windows and run Sql Management studio?

ahnedullah said...

how to login as administrator