Microsoft sql server error 262 как исправить

Microsoft sql server error 262 как исправить This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions. Answered by: 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 […]

Содержание

  1. Microsoft sql server error 262 как исправить
  2. Answered by:
  3. Question
  4. Answers
  5. All replies
  6. MS SQL Error 262 – How to fix
  7. SQL error 262 occurs when..
  8. Fixes for MS SQL Error 262
  9. Conclusion
  10. PREVENT YOUR SERVER FROM CRASHING!
  11. 2 Comments
  12. Microsoft sql server error 262 как исправить
  13. Вопрос
  14. Ответы
  15. Все ответы

Microsoft sql server error 262 как исправить

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Answered by:

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.

Answers

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

try the following:

then try with explicitely specifying the path to the files.

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.

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

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.

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.

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

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)

Источник

MS SQL Error 262 – How to fix

MS SQL users sometimes run into “SQL Error 262” while creating a new database, logging into SQL Server Management Studio, etc.

Here at Bobcares, we routinely see & resolve MS SQL errors such as this as part of our MS SQL Support services.

Today we will go through the top causes for this error, and how to fix it.

SQL error 262 occurs when..

  • Trying to create new database in SQL Server Management Studio.
  • Logging on SQL Server Management Studio.
  • User tries to check the execution plan.
  • Trying to connect to local SQL Server Express instance using a third party application.

Now, lets see how to fix it.

Fixes for MS SQL Error 262

Some of the possible fixes for MS SQL error 262 are:

  • Grant Database Access to a single user.
  • Resolve issue in SQL Express.
  • Add Windows user to sysadmin role.

Now let’s see how to implement these fixes.

Grant Database Access to a single user

One of the scenarios where this SQL 262 error appears is when the user tries to check the execution plan using CTRL + M.

An execution plan is used to check how query will behave without having to execute it.

So, for including the execution plan in the query, we can allow SHOWPLAN access to the user.

Allowing particular user to grant the SHOWPLAN access using the commands shown helps in fixing SQL error 262.

USE DatabaseName
GO
GRANT SHOWPLAN TO UserName
GO

This helps fixing the error.

Fixing issue with SQL Server Express

We may encounter the 262 error while trying to connect to a local SQL Server Express Instance from a third party application.

We can fix this error using the steps shown:

  • Firstly, follow the path:- Start>All Programs >Microsoft SQL Server>Configuration Tools >SQL Server Surface area Configuration
  • Then, click on Add New Administrator
  • Next, move to Member of SQL Server SysAdmin role on SQLEXPRESS and Add it to right-box.
  • Finally, click on OK

Add Windows user to sysadmin role.

One of the reasons behind this 262 error to appear is not having an account available on SQL Server with sysadmin role.

There are two ways to add Windows user to the sysadmin fixed server role:

To add Windows user with login “machinenameAdministrator”

  • Using the credentials for the machinenameAdministrator account log on to the computer.
  • Then, click Start and follow the path:- All Programs > Microsoft SQL Server >SQL Server Management Studio
  • Next, connect to an instance of SQL Server.
  • Now, follow the path:- Security>right-click Logins>New Login.

  • Enter the user name In the Login name box,
  • Finally, in the Select a page>Server Roles

  • Finally, select sysadmin check box and then click OK.

To add Windows user with login “domainname username”

  • Using the credentials for the domainnameusername account log on to the computer .
  • Next, follow the path:- Start> All Programs > Microsoft SQL Server >SQL Server Management Studio.
    Note: “Run As Administrator” option elevates the user permissions In the User Access Control dialog box, click Continue.
  • Then, connect to an instance of SQL Server in SQL Server Management Studio .
  • Next, follow the path >> Security>>right-click Logins>>click New Login.
  • Enter the user name in the Login name box,.
  • Finally, Go to Select a page, click Server Roles, select the sysadmin check box, and then click OK.

[Need assistance in fixing MS SQL errors? We are available 24×7.]

Conclusion

In short, MS SQL error 262 may occur in different scenarios like creating new database in SQL Server Management Studio, connecting to local SQL Server Express Instance from a third party application, etc. Today, we discussed in detail the possible ways by which we can handle such scenarios to fix this error.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

Hello, I have tried following these instructions to fix SQL Server Error 262 CREATE DATABASE Permission Denied, with no success. I am wondering if some of the information may be outdated or if program paths could be labeled differently on different devices.
I only just downloaded this program and the required services and followed the basic installation wizards.

Any assistance would be appreciated.
Thanks!

Hello Karma,
Please contact our support team via live chat(click on the icon at right-bottom).

Источник

Microsoft sql server error 262 как исправить

Вопрос

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.

Ответы

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

try the following:

then try with explicitely specifying the path to the files.

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.

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

Все ответы

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.

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.

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

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)

Источник

Descriptive Solution to Fix Microsoft SQL Error 262

I am launching Microsoft SQL Server management studio by running it with option of ‘Run as administrator’. I am facing none of the errors at the time of establishing Windows Authentication connection. But, when I select the option for creating ‘new database’, I encounter an error dialog box. This dialog box is restricting me from creating new database in SQL server. I don’t know what has happened in the servers but, all what I want is to fix the problem ASAP. Is there any SQL expert who can provide solution for this SQL error 262?

One of the popular error faced by Microsoft server administrators is denial of permissions to create a new database in MS SQL server management studio. Microsoft SQL server database creation error 262 usually occurs due to the presence of some issue in Windows Authentication connection. The error statement states that the current account is not having rights to sign into the SQL server.

Microsoft SQL server database creation error 262

Measures to Quickly Fix SQL Error 262

Following illustrated are the solution for troubleshooting the SQL server database creation error 262 in shortest time duration :

Measure 1 : Permit Database Access to Single User

The SQL server error 262 appears when the server users try to verify the execution plan via Ctrl + M. In comparison to the execution plan, it is quite tough to view the query plan. Therefore, an execution plan is calculated in place of the query plan, which is initiated without running the SQL server query plan. The main aim of doing so is to analyze the behavior of query, prior to its execution. Execution plan in a query can be consolidated by permitting end users with SHOWPLAN access. Following commands will help in resolving the Microsoft SQL error 262 after giving SHOWPLAN access permission :

USE DatabaseName
GO
GRANT SHOWPLAN TO UserName
GO

Execute the commands on the database where you are facing problem at the time of database creation in SQL server.

Measure 2 : Fix the Error Using Microsoft SQL Express

There might be a condition where end users face SQL server database creation error 262 when they are trying to establishing connection between the local instance of SQL server and 3rd party app. In this scenario, use following steps for SQL error 262 fixation :

1. Click on Start >> All Programs >> Microsoft SQL Server >> Configuration Tools >> SQL Server Surface Area Configuration
2. Click on the Add New Administrator and then navigate towards ‘Member of SQL Server SysAdmin role on SQLEXPRESS
3.  Add the respective option in the right-box and then, click on OK button

Now there are two methods for adding Windows OS users in the SysAdmin fixed server role. Description of both these approaches are mentioned-below :

Using ‘machinenameAdministrator’

  • Sign-in into your Computer via account information of machineadministrator
  • Click on Start >> All Programs >> Microsoft SQL Server >> SQL Server Management Studio
  • Now establish a connection with SQL Server instance to proceed with resolving of SQL error 262
  • Click on the Security tab and right-click on Logins
  • From the list of options, select New Login option
  • Now in the login name box, type the new username
  • Navigate towards Select a page, choose the Server Roles and then, enable the checkbox of SysAdmin
  • At last, click on OK button to fix Microsoft SQL server database creation error 262

Using ‘domainnameusername’

  • Make use of domainnameusername credentials to login to the PC
  • Click on Start >> All Programs >> Microsoft SQL Server and then, right-click on the SQL Server Management Studio
  • Choose the option of Run As Administrator
  • When connection with SQL Server instance gets established, click on Security Tab
  • Right-click on the Logins for creation of new username
  • Go to the Select a Page section and click on Server Roles
  • Activate the checkbox of SysAdmin and then, click on OK

That’s It For Problem Resolving

All possible measures to troubleshoot SQL error 262 at the time of database creation is illustrated in this post. Microsoft server administrators can execute these measures, if they are encountering same sort of problem. The solutions are provided by Invorx team of SQL experts and they give assurance that one of the provided solutions will definitely work on your platform.

Problem

One of the common errors faced by SQL Server Database users is denial of permission while trying to create a new database in SQL Server Management Studio displaying an error code 262. The problem is encountered due to issues in Windows Authentication Connection that states that the account does not have rights to login to SQL Server. The SQL Server Error 262 displays the following error message defined below:

Microsoft SQL Server Error 262

Solutions To Fix Microsoft SQL Server Error 262

Below are the possible solutions to resolve the create database permission denied error 262:

Grant Database Access to a single user

SQL Server Error 262 can appear when user tries to check the execution plan using CTRL + M. As it is difficult to see the plan for any query, execution plan can be used. A calculated execution plan is a SQL Server query plan that is created without actually running the query plan. Its main purpose is to check how query will behave without having to execute it. In order to include the execution plan in the query, we can allow user to grant SHOWPLAN access to the user. Fixing the error is possible by providing particular user the SHOWPLAN access using following commands:

USE DatabaseName
GO
GRANT SHOWPLAN TO UserName
GO

We can run the commands in the database where user faces the issue to make them view the query execution plan without any complications.

Resolve issue in SQL Express

User may encounter Microsoft SQL Server Error 262 while trying to connect to local SQL Server Express Instance from a third party application. We can fix the issue using the steps below:

  • Go to Start> All Programs > Microsoft SQL Server> Configuration Tools >SQL Server Surface area Configuration
  • Click on Add New Administrator
  • Go to ‘Member of SQL Server SysAdmin role on SQLEXPRESS’ and Add it to right-box
  • Click on OK

There are two ways to add Windows user to the SysAdmin fixed server role:

In case of ‘machinenameAdministrator’

  • Log on the Computer using account details of machineadministrator
  • Go to Start> All Programs > Microsoft SQL Server >SQL Server Management Studio
  • Now, we will connect to an instance of SQL Server
  • Go to Security tab, right-click on Logins and then Click New Login
  • Enter a new user name on the login name box.
  • Go to Select a page, select Server Roles and click on check box of SysAdmin and then OK

In case of ‘domainnameusername’

  • Using the account details of domainnameusername, log on to the computer
  • Go to Start> All Programs > Microsoft SQL Server and right-click on SQL Server Management Studio and select Run as Administrator
  • After connecting to an instance of SQL Server, go to Security Tab> right-click on Logins to create a new user name
  • Click on Server Roles under Select a Page tab, click on check box of SysAdmin and then click on OK

Conclusion

The blog has been aimed to focus on one of the SQL Server Error that user encounters while trying to create a new database, i.e. Microsoft SQL Server error 262. It further describes the possible solutions to guide users in resolving the create database permission denied error.

  • Remove From My Forums
  • 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

     

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:TEMPtest1.mdf' )
     LOG ON 
    ( NAME = N'test1_log', FILENAME = N'C:TEMPtest1.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

      Thursday, May 17, 2012 8:48 AM

  • 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

  • Remove From My Forums
  • Question

  • Hi, I’ve seen this issue posted before, but I went through all the posts and wasn’t able to get it to work.  I’m completely new to SQL and a client just dropped me off a 4gb .bak file that i need to figure out how to get into and hopefully over to excel
    where i know where i’m doing.  i saw online that the way to load a .bak file is to create a new database in sql server management studio, then restore from the .bak file.  however, if i try to create a database i get error 262.  if i try to
    give sysadmin privileges to the builtinusers group i get the same error.

    i saw the advice to run smss as a system administrator from the start menu, but i think that only works in vista.  i’m using win7 professional.   i also saw some other solutions with command lines to run in single user mode, but i’m not familiar
    with the syntax and simply copy/pasting them into my cmd prompt didn’t work, so if the solution is lines of code, please explain clearly the order of operations to get it though.  thank you very much for the help, and patience with my limited knowledge
    on this subject!

Answers

  • Msg 262 comes with different flavours as below. 

    Msg 262, Level 14, State 1, Line 1
    CREATE DATABASE permission denied in database ‘master’.

    Msg 262, Level 14, State 1, Line 3
    CREATE TABLE permission denied in database ‘FooBar’.

    Please let us know complete message

    1. Without restoring, could you please run «create database foo» command from ssms and post complete message.
    2. Can you add your own login explicitly and make it sysadmin?
    3. Is that a workgroup computer or domain computer?


    Balmukund Lakhani | Please mark solved if I’ve answered your question, vote for it as helpful to help other user’s find a solution quicker

    ———————————————————————————
    This posting is provided «AS IS» with no warranties, and confers no rights.

    ———————————————————————————
    My Blog: http://blogs.msdn.com/blakhani

    Team Blog: http://blogs.msdn.com/sqlserverfaq

    • Marked as answer by

      Friday, January 14, 2011 1:38 PM

  • Remove From My Forums
  • Question

  • Hi, I’ve seen this issue posted before, but I went through all the posts and wasn’t able to get it to work.  I’m completely new to SQL and a client just dropped me off a 4gb .bak file that i need to figure out how to get into and hopefully over to excel
    where i know where i’m doing.  i saw online that the way to load a .bak file is to create a new database in sql server management studio, then restore from the .bak file.  however, if i try to create a database i get error 262.  if i try to
    give sysadmin privileges to the builtinusers group i get the same error.

    i saw the advice to run smss as a system administrator from the start menu, but i think that only works in vista.  i’m using win7 professional.   i also saw some other solutions with command lines to run in single user mode, but i’m not familiar
    with the syntax and simply copy/pasting them into my cmd prompt didn’t work, so if the solution is lines of code, please explain clearly the order of operations to get it though.  thank you very much for the help, and patience with my limited knowledge
    on this subject!

Answers

  • Msg 262 comes with different flavours as below. 

    Msg 262, Level 14, State 1, Line 1
    CREATE DATABASE permission denied in database ‘master’.

    Msg 262, Level 14, State 1, Line 3
    CREATE TABLE permission denied in database ‘FooBar’.

    Please let us know complete message

    1. Without restoring, could you please run «create database foo» command from ssms and post complete message.
    2. Can you add your own login explicitly and make it sysadmin?
    3. Is that a workgroup computer or domain computer?


    Balmukund Lakhani | Please mark solved if I’ve answered your question, vote for it as helpful to help other user’s find a solution quicker

    ———————————————————————————
    This posting is provided «AS IS» with no warranties, and confers no rights.

    ———————————————————————————
    My Blog: http://blogs.msdn.com/blakhani

    Team Blog: http://blogs.msdn.com/sqlserverfaq

    • Marked as answer by

      Friday, January 14, 2011 1:38 PM

Понравилась статья? Поделить с друзьями:
  • Microsoft office word сбой активации продукта как исправить
  • Microsoft office cannot open this file because some parts are missing or invalid как исправить
  • Microsoft office 2016 сбой активации продукта как исправить
  • Microsoft office 2013 сбой активации продукта как исправить
  • Microsoft office 2013 error code 0 1011