3

I have installed SQL SERVER 2008 R2 on my system with Windows XP operating system installed.

Whenever I try to create a new database it displays an error:

CREATE DATABASE PERMISSION DENIED IN DATABASE 'master'.(Microsoft SQL Server, Error:262)
Pondlife
  • 15,992
  • 6
  • 37
  • 51
LogicalDesk
  • 1,237
  • 4
  • 16
  • 46

8 Answers8

4

When you start SQL server management studio use 'sa' user and not Windows-User. Looks like Windows-user does not have permission.

4

Right-click and run "SQL Server Management Studio" as administrator.

Brian
  • 41
  • 1
3

Try to grant the user your loged in the CREATE ANY DATABASE Permission then try again. Take a look at the documentation about creating a new Database

CloudyMarble
  • 36,908
  • 70
  • 97
  • 130
  • if that user is unable to grant permission to the user I have logged in then? – LogicalDesk Jan 31 '13 at 12:51
  • You need to log in with the Admin user to grant this User the needed Permission, this depends on the Option you choosed when you installed the Server, you can use a Windows authentication or a SQL Server one where you provide the Username and Password, this User should be used. – CloudyMarble Jan 31 '13 at 13:04
2

Cause of this error is insufficient permission. Give the user "dbcreater" role check dbcreater role

Ahmet Arslan
  • 5,380
  • 2
  • 33
  • 35
1

Check it: SqlSever>>Security>>Logins>>BUILTIN\Users rightClick -->Properties -->Server Roles ...select sysadimn

Ram-25
  • 11
  • 3
0

If you are in a situation where you have public/view only access to a SQL database you should consider the following:

  1. Do you have an alternate login or the sa user login credentials? If so, try this first and, if necessary, grant your other login sufficient privileges via the Security/Logins/.. section of your database in the Object Explorer panel (see Ahmet Arslan's answer).

  2. If you have account access to another Windows user who has access via Windows Authentication, try running ssms.exe as the other user via the "runas" command. Full details and explanation here in the answer from SqlRyan.

  3. If you have old databases from a previous Windows installation that had been configured with Windows Authentication (and you do not have/remember the sa account credentials). In this situation, you can recreate your past user account from your previous Windows installation. Be sure this new account has the same Domain and Username as your previous account. Login via the recreated account, and give your current (or "real") user account sufficient permissions (see #1. above). Once you confirm that you have restored access, you can then delete the recreated user account.

Community
  • 1
  • 1
islane
  • 93
  • 1
  • 5
0

With this problem, I noticed I was connected using Windows Authentication. I then disconnected and used SQL Server Authentication. It is good now.

Baqer Naqvi
  • 6,011
  • 3
  • 50
  • 68
  • First time user. when I do SQL Server Authentication it is asking username and password. Any idea what is the default username/password? – william cage Jul 04 '17 at 22:25
  • @williamcage SQL Server 2008/R2 Express User: sa Password: [blank password - leave field empty to connect] SQL Server 201x Express User: sa Password: Password123 SQL Server 20xx Web or Standard User: sa Password: will be the same as your administrator or root user password at the time the VDS was provisioned. – Baqer Naqvi Jul 05 '17 at 11:38
0

first you will login on windows authentication then you will click on login (sa) properties and server role check in db creater then ok click then error is solved and after login within sa and create a database