SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 CREATE DATABASE permission denied...
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

astralis
Yak Posting Veteran

USA
58 Posts

Posted - 03/05/2013 :  23:05:18  Show Profile  Reply with Quote
I've had a SQL Server 2008 Express running for several years with no problem, including adding new databases.

Today I went to add a new database and received this message:

CREATE DATABASE permission denied in database 'master'. (.Net SqlClient Data Provider)

The help files that I've found state that this is a problem when installing SQL Server, but this SQL Server Express has been installed for years and I haven't added or removed any new users on SQL Server nor on Windows.

Please advise.

James K
Flowing Fount of Yak Knowledge

3323 Posts

Posted - 03/05/2013 :  23:23:36  Show Profile  Reply with Quote
If you have been able to create databases using the same login in the past, and if nothing else has changed, check if the Windows password has expired.

Examine the call stack to see if you get any additional information.

Login to SQL Server using SSMS and try to create a database to verify that you are able to do so.
Go to Top of Page

astralis
Yak Posting Veteran

USA
58 Posts

Posted - 03/05/2013 :  23:27:52  Show Profile  Reply with Quote
quote:
Originally posted by James K

If you have been able to create databases using the same login in the past, and if nothing else has changed, check if the Windows password has expired.


Windows password has not expired. I'm actually creating the database on the server's machine.
quote:

Examine the call stack to see if you get any additional information.


I'll check but I don't know if I can interpret it.
quote:

Login to SQL Server using SSMS and try to create a database to verify that you are able to do so.


That's what I was doing on the server's machine.

Edited by - astralis on 03/05/2013 23:28:40
Go to Top of Page

James K
Flowing Fount of Yak Knowledge

3323 Posts

Posted - 03/05/2013 :  23:45:46  Show Profile  Reply with Quote
Because of the error message I assumed that you were connecting from a .Net client using SMO or ADO.Net etc.

If you are using SSMS and still not able to create the database:

1. for testing purposes, connect using a login that has sysadmin privileges and see if that user is able to create databases.
2. if they are, then grant privilege to the less privileged user:
USE [master]
GO 
GRANT CREATE ANY DATABASE TO TheLessPrivilegedUser;
Even though nothing that you know of has changed, obviously something must have - I just don't have enough information to say what that might be.
Go to Top of Page

astralis
Yak Posting Veteran

USA
58 Posts

Posted - 03/06/2013 :  00:33:17  Show Profile  Reply with Quote
Interesting. That user no longer has admin privileges. Instead of using SQL Authentication, I used Windows Authentication, and now I can do what I need to do.

But I never removed admin privileges from the user via SQL Authentication and no one but me can access the server.

Maybe, just maybe, I've always used Windows Authentication. I would think I'd remember something like that.

I appreciate your help.

Hopefully this post can help someone for such a simple fix.
Go to Top of Page

James K
Flowing Fount of Yak Knowledge

3323 Posts

Posted - 03/06/2013 :  08:33:01  Show Profile  Reply with Quote
If you are logged in to SSMS on a sysadmin account, and if you are getting that error message, I don't know what could be causing that.

If you do find out, can you post back, so all can learn?
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000