SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Granting role to dbo
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Peter99
Constraint Violating Yak Guru

485 Posts

Posted - 02/06/2013 :  12:00:14  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

United Kingdom
2004 Posts

Posted - 02/07/2013 :  01:54:02  Show Profile  Visit jackv's Homepage  Reply with Quote
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 - 02/08/2013 :  13:51:38  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

United Kingdom
2004 Posts

Posted - 02/09/2013 :  06:25:17  Show Profile  Visit jackv's Homepage  Reply with Quote
the error message you're seeing is intended behaviour

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000