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.
GRANT SHOWPLAN TO UserName
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.]
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.