Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Granting role to dbo

Author  Topic 

Peter99
Constraint Violating Yak Guru

498 Posts

Posted - 2013-02-06 : 12:00:14
Hi,

I have one login say test and executed:

use <db name>

go

sp_changedbowner test

I have user defined role role1 in this database.

I want to grant role1 to test. Now test has user dbo in the database. When I tried to grant this role to test/dbo there is error:

"Add member failed for databaserole 'role1'

.....

cannot user special principal 'dbo' (... Error 15405).

In SSMS, I right clicked login name, in properties selected user mapping, selected database, selected that role. When I clicked OK there is above error. Any help?

Thanks

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2013-02-07 : 01:54:02
If they are already db_owner , why do you need to assign further permissions. db_owner implies this logon can already do anything in the database

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page

srimami
Posting Yak Master

160 Posts

Posted - 2013-02-08 : 13:51:38
This is happening because the user 'test' is the actual owner of the database - as such, they can only have db_owner, and cannot be assigned any further database roles.

Nor do they need to be. If they're the DB owner, they already have permission to do anything they want to within this database.
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2013-02-09 : 06:25:17
the error message you're seeing is intended behaviour

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page
   

- Advertisement -