Home » SQL Server Error : 262, Severity: 16. %ls permission denied in database ‘%.*ls

SQL Server Error : 262, Severity: 16. %ls permission denied in database ‘%.*ls

sql server DBA 999

SQL Server Error : 262 Details


SQL Server Error: 262
Severity: 16
Event Logged or not: No
Description:
%ls permission denied in database ‘%.*ls’.
Severity 16 Description:
Indicates general errors that can be corrected by the user.

Cause:

Sql Server error 262 is common error faced by SQ Server users when they are trying to create new database in SQL Server Management Studio. This error also appear during login on SSMS. A message is returned that states that the account does not have “sysadmin” role to SQL Server.

Another reason is that, as of SQL 2008, the local Administrators group is no longer added by default during SQL Server installation. Even adding the current user as a local administrator requires a manual step. This means that you could be completely locked out of your own SQL Server instance, especially if you don’t use mixed authentication (or have forgotten the sa password).

For whatever reason, you do not have a SQL Server account with the “sysadmin” role. As a result, you cannot edit other users’ “user mapping” to add the specific database. The following article will explain how to resolve problems with privileges and permissions.

Error:

CREATE DATABASE permission denied in database ‘master’. (Microsoft SQL Server, Error: 262)

Reading sql server error log location from SQL Query

Identifying SQL Server Error Log File used by SQL Server Database Engine can be done by reading SQL Server Error Logs. DBA can execute the XP_READERRORLOG extended stored procedure to read the SQL Server Error Log and search for its location used by the instance of SQL Server.

USE master
Go
xp_readerrorlog 0, 1, N'Logging SQL Server messages in file', NULL, NULL, N'asc'
Go

Solution for Resolving the Error

  1.  Solution 1 assumes that you have a login account with the “sysadmin” role. This case assumes you have a SQL Server account with sysadmin privileges, such as Admin. During SQL Server installation, you must specify (at least one) system administrator for the SQL Server instance, or a SA account if you are using mixed mode authentication. To gain access to your SQL Server, you must use that account’s credentials.
    After logging into SQL Server Management Studio with this account, you can create or edit other users (in this case, the user who is experiencing the error) to grant them the sysadmin role.
    Log in to the computer with the Administrator account credentials.

Click the Start button, point to All Programs, click Microsoft SQL Server, and then click SQL Server Management Studio. Connect to the instance of SQL Server. Click Security, right-click Logins, and then click New Login. In the Login name box, enter the user name. In the Select a page , click Server Roles, select the sysadmin check box, and then click OK.

How to gain sysadmin access on SQL Server when we don’t have any user with “sysadmin” role?

The worst place to be in is to when you don’t have any sysadmin user to login on the system. The single option is to start SQL server in a single user mode, in that case anyone who is local administrator on that computer can connect to SQL Server as a member of sysadmin fixed server role.

SQL Server Error Code and solution summary


SQL Server Error: 262
Severity: 16
Event Logged or not: No
Description:
%ls permission denied in database ‘%.*ls’ .

Login as SysAdmin user with login with permissions as sysadmin that is sa and add other users and grant permissions

Leave a Reply

Your email address will not be published. Required fields are marked *