7

I am trying to create a database using SQL Server Management Express. The following error occurs:

TITLE: Microsoft SQL Server Management Studio Express

Create failed for Database 'dbTestDBase'. (Microsoft.SqlServer.Express.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Create+Database&LinkId=20476

ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Express.ConnectionInfo)

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

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1399&EvtSrc=MSSQLServer&EvtID=262&LinkId=20476

9 Answers 9

10

Run Microsft SQL Server Studio as administrator....your problem will be solved

2
  • 1
    I'm feeling so stupid right now. Big facepalm! Thanks!
    – Francute
    Dec 14, 2017 at 0:44
  • not in my case .... Dec 28, 2022 at 15:04
2

I had this same problem. but solved! you should go to your specify folder where database created (ex:C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\DATA) then right click on data folder -> properties-> advanced then uncheck compress content to save disk space. that's it.

1

It's very clear: the credential you are using doesn't have enough privileges to be able to create a new database. Are you logged in using Integrated Windows Authentication or Sql Server Authentication? Make sure your credentials have the dbcreator role either way.

http://msdn.microsoft.com/en-us/library/ms176014%28v=SQL.90%29.aspx

1
  • I am logged in as administrator Nov 11, 2010 at 6:26
1

If the computer is part of Domain. Log-in as local administrator account on the work station (maybe because the MSQSQL is installed on the computer using local administrator account, means that the local administrator account has systemadmin access on SMSQL), then when you are already logged as local administrator. open the MSSQL , now add/edit MSSQL security account.

0

Well, the error message seems to be pretty clear:

CREATE DATABASE permission denied in database 'master'.

Obviously, the user account you're using doesn't have the permission to create a new database. Is that possible? What kind of user are you using?

Also: can you show us the CREATE DATABASE statement you're using??

0

Just check whether path is specified or not

For example : "C:..\MSSQL\DATA", in both the columns of Database files in the New Database wizard

0

I hope this solution will help someone!

My problem started when I had deleted the previous user from PC Management and from registry. Then I create a fresh-std user. and trying to create database from the new user, and that's where my problem started.

After searching for the better solution, I conclude by Uninstalling MS Server Express Database completely from my PC and re-install it again. This save time and solved my problem.

I hope this solution helps someone too!

0

I had similar issue and was solved by executing below command


--Step1 Find if it is used by some other PID
Use
master
GO

IF
EXISTS(SELECT request_session_id FROM
sys.dm_tran_locks

WHERE resource_database_id =
DB_ID('Model'))
PRINT
'Model Database being used by some other session'
ELSE
PRINT
'Model Database not used by other session'

-- Step 2 - Identify
SELECT request_session_id FROM
sys.dm_tran_locks

-- Step 3 Get PID

WHERE resource_database_id =
DB_ID('Model')

-- Step 4 Get the EventInfo
DBCC InputBuffer(214)

-- Step 5 Kill the PID  
     Kill 214

Hope this helps

-1

I had the same problem when trying to create the database with Right Click + New Database on Databases.

The solve was using New Query and the command to create database:

CREATE DATABASE databasename;

In the end I want to mention that I was logged in Management Studio with (localdb)\v11.0 over windows authentication.

1
  • It still gives the same error after executing Aug 6, 2021 at 12:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.