Problem creating database using SQL Server Management Express
Asked Answered
Q

10

8

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

Quaver answered 10/11, 2010 at 17:50 Comment(0)
S
11

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

Smote answered 8/9, 2014 at 19:20 Comment(2)
I'm feeling so stupid right now. Big facepalm! Thanks!Sachs
not in my case ....Schertz
A
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.

Agueweed answered 30/5, 2019 at 7:54 Comment(0)
S
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

Scarlatti answered 10/11, 2010 at 17:53 Comment(1)
I am logged in as administratorQuaver
V
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.

Vivien answered 10/4, 2015 at 3:49 Comment(0)
E
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??

Eligible answered 10/11, 2010 at 17:53 Comment(0)
C
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

Commodus answered 13/2, 2015 at 7:5 Comment(0)
S
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!

Snapper answered 24/5, 2019 at 11:45 Comment(0)
L
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

Longshore answered 2/8, 2019 at 2:15 Comment(0)
S
0

I have same the issue. The solution is : Uncheck "Compress contents to save disk space" which folder we save the database ( the Path- when we create new database)

Subcontract answered 19/4 at 9:6 Comment(0)
K
-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.

Konyn answered 24/8, 2017 at 20:7 Comment(1)
It still gives the same error after executingSmitherman

© 2022 - 2024 — McMap. All rights reserved.