locked
SQL Server 2012 error 262 RRS feed

  • Question

  • Hey everyone I'm trying to create a new database in SQL Server 2012 and keep getting the 262 error.  (Create database permission denied in database "master".(microsoft sql server error:262)

    I'm running on Windows 7 home premium 64 bit, am on the administrative account and have set permissions in the properties to allow me to do everything...

    I'm not sure what else to try and any help would be much appreciated! Thanks in advance.

    -Joe

     
    Wednesday, May 9, 2012 5:19 PM

Answers

  • hello Joseph

    could you try to create using t-sql in a query window?

    try the following:

    CREATE DATABASE [test]
    

    then try with explicitely specifying the path to the files.

    CREATE DATABASE [test1] ON  PRIMARY 
    ( NAME = N'test1', FILENAME = N'C:\TEMP\test1.mdf' )
     LOG ON 
    ( NAME = N'test1_log', FILENAME = N'C:\TEMP\test1.ldf')
    

    replace the path c:\temp by a directory of your choice where the SQL Server service account does have full control.

    could you please check the default setting for database default locations ? start SSMS, connect to server, select server, open Properties dialog, select "Database Settings", check "Database default locations", they must not be empty and the SQL Server service account needs read/write access to this folder.


    Please use Mark as Answer if my post solved your problem and use Vote As Helpful if a post was useful.

    • Marked as answer by Maggie Luo Thursday, May 17, 2012 8:48 AM
    Thursday, May 10, 2012 2:50 PM
  • You said "I set it to windows authentication only" and you also said "am using the SA account". These are mutually exclusive. That is, if your instance of SQL Server is set to Windows Authentication only, then the sa account cannot be used to connect. So... I think you must really be connecting using your domain login and Windows Authentication. And that account is probably not a member of the sysadmin fixed server role. These three queries will help you figure out who SQL Server thinks you are, and what permissions you have.

    SELECT SUSER_NAME() AS YourLogin, USER_NAME() AS YourDBUserIdentity;
    SELECT IS_SRVROLEMEMBER('sysadmin') AS True_is1_False_is0;
    SELECT permission_name, state_desc FROM sys.server_permissions WHERE grantee_principal_id = SUSER_ID();


    Rick Byham, Microsoft, SQL Server Books Online, Implies no warranty

    • Marked as answer by Maggie Luo Thursday, May 17, 2012 8:48 AM
    Thursday, May 10, 2012 3:52 PM
    Answerer

All replies

  • Hi Joe, are you trying to create the database through SQL Server Management Studio or through another means?  When you say you are using the administrative account, are you referring to the Windows OS administrative account?  If so, which account are you using to connect to your SQL Server instance?

    Thanks,
    Sam Lester (MSFT)


    This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click "Mark as Answer" and "Vote as Helpful" on posts that help you. This can be beneficial to other community members reading the thread.

    Wednesday, May 9, 2012 5:43 PM
  • Can you try running SSMS "as administrator "( right click on the icon and select Run as administrator)

    Regards,
    Ahmed Ibrahim
    SQL Server Setup Team
    This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click "Mark as Answer" and "Vote as Helpful" on posts that help you.
    This can be beneficial to other community members reading the thread.

    Wednesday, May 9, 2012 11:47 PM
  • Yes I am using SQL Server Management Studio but have also tried with Razor SQL and am getting the same 262 error in both, I'm on the OS admin account and am using the SA account to connect to my SQL server instance. When installing SQL I set it to windows authentication only, not sure if that makes a difference or not. 

    EDIT: I just added my admin account to the login and tried running it and still no good.

    EDIT 2: I just tried to change the log on properties in the user and got the following error:

    TITLE: Microsoft SQL Server Management Studio
    ------------------------------

    Create failed for User 'xxxxxx'.  (Microsoft.SqlServer.Smo)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=11.0.2100.60+((SQL11_RTM).120210-1917+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Create+User&LinkId=20476

    ------------------------------
    ADDITIONAL INFORMATION:

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

    ------------------------------

    User does not have permission to perform this action. (Microsoft SQL Server, Error: 15247)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=11.00.2100&EvtSrc=MSSQLServer&EvtID=15247&LinkId=20476

    ------------------------------
    BUTTONS:

    OK
    ------------------------------


    Thursday, May 10, 2012 1:50 PM
  • Yes I've tried this and am still getting the same error.
    Thursday, May 10, 2012 1:52 PM
  • hello Joseph

    could you try to create using t-sql in a query window?

    try the following:

    CREATE DATABASE [test]
    

    then try with explicitely specifying the path to the files.

    CREATE DATABASE [test1] ON  PRIMARY 
    ( NAME = N'test1', FILENAME = N'C:\TEMP\test1.mdf' )
     LOG ON 
    ( NAME = N'test1_log', FILENAME = N'C:\TEMP\test1.ldf')
    

    replace the path c:\temp by a directory of your choice where the SQL Server service account does have full control.

    could you please check the default setting for database default locations ? start SSMS, connect to server, select server, open Properties dialog, select "Database Settings", check "Database default locations", they must not be empty and the SQL Server service account needs read/write access to this folder.


    Please use Mark as Answer if my post solved your problem and use Vote As Helpful if a post was useful.

    • Marked as answer by Maggie Luo Thursday, May 17, 2012 8:48 AM
    Thursday, May 10, 2012 2:50 PM
  • You said "I set it to windows authentication only" and you also said "am using the SA account". These are mutually exclusive. That is, if your instance of SQL Server is set to Windows Authentication only, then the sa account cannot be used to connect. So... I think you must really be connecting using your domain login and Windows Authentication. And that account is probably not a member of the sysadmin fixed server role. These three queries will help you figure out who SQL Server thinks you are, and what permissions you have.

    SELECT SUSER_NAME() AS YourLogin, USER_NAME() AS YourDBUserIdentity;
    SELECT IS_SRVROLEMEMBER('sysadmin') AS True_is1_False_is0;
    SELECT permission_name, state_desc FROM sys.server_permissions WHERE grantee_principal_id = SUSER_ID();


    Rick Byham, Microsoft, SQL Server Books Online, Implies no warranty

    • Marked as answer by Maggie Luo Thursday, May 17, 2012 8:48 AM
    Thursday, May 10, 2012 3:52 PM
    Answerer
  • Hi please check the given link, it may help you.

    http://sqlserverpedia.com/blog/sql-server-bloggers/sql-server-%E2%80%93-fix-error-262-showplan-permission-denied-in-database/

    Monday, May 14, 2012 10:16 AM