Cannot alter the role 'db_owner', because it does not exist or you do not have permission.


This post describes how to fix the error "Cannot alter the role 'db_owner', because it does not exist or you do not have permission". This also applies to the role 'db_datareader'.

Cause

This can occur if your server collation is case sensitive and you're trying to alter a role in SQL using the sp_addrolemember stored procedure e.g.

EXEC sp_addrolemember 'db_Owner', 'dbo';

To check your server collation:

SELECT SERVERPROPERTY('COLLATION');

To check your database collation:

SELECT DATABASEPROPERTYEX('%DATABASENAME%', 'Collation') SQLCollation;

Note: You can get a description of each COLLATION using this query:

SELECT * FROM fn_helpcollations();


Solution

Change your server collation or ensure the role you want to alter matches exactly including case.

EXEC sp_addrolemember 'db_owner', 'dbo';


Video

Watch the video: Cannot alter the role, because it does not exist or you do not have permission

Related Posts

Database is not configured for database mirroring. (Microsoft SQL Server, Error: 1416)

The client and server cannot communicate, because they do not possess a common algorithm

Comments

Popular posts from this blog

LG TV This app will now restart to free up more memory

What is the "W" light on a Steelseries keyboard?

Excel Import CSV not using "Use First Row as Headers"