Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Unable to remove user from db_owner role membership...why?


Unable to remove user from db_owner role membership...why?

Author
Message
ejoell 66477
ejoell 66477
SSC Rookie
SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)

Group: General Forum Members
Points: 34 Visits: 97
George, in the original post dbajunior said "I uncheck db_owner, then click OK." Well in my version of SQL Server 2008, the login mapped to dbo is not listed in the users list of the databases except as dbo, you can not map a login that is already in the database as another user as dbo, and the in the user mapping area of the logins properties, trying to remove the check for db_owner generates an exception 'cannot use special principal dbo' so he would never be able to successfully click "OK".

dbajunior; In your original attempt were you looking at the user as listed in the security\users folder of the database, or the user mapping page of the login properties under the server's security\logins folder?

Also just for fun and giggles why don't you run "sp_Changedbowner 'sa' " in that databae. Then try see if your user in listed in the security\users folder of the database. If it is not then it was mapped to the "dbo" user. If you see it there then that was not the issue.
george sibbald
george sibbald
SSCertifiable
SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)

Group: General Forum Members
Points: 6334 Visits: 13687
ejoell 66477 (9/21/2011)
George, in the original post dbajunior said "I uncheck db_owner, then click OK." Well in my version of SQL Server 2008, the login mapped to dbo is not listed in the users list of the databases except as dbo, you can not map a login that is already in the database as another user as dbo, and the in the user mapping area of the logins properties, trying to remove the check for db_owner generates an exception 'cannot use special principal dbo' so he would never be able to successfully click "OK".


it can happen if the user is defined in the database already and then that user creates the database by attach or restore, user will also become dbo.

---------------------------------------------------------------------
bloggerpillai
bloggerpillai
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 Visits: 86
I think this should work.

sp_change_users_login 'dbo', 'dbo', 'Update_one'

The issue at least to me - was my dbo was mapped to the wrong user. And that is a no-go.

You will get this error:
"Terminating this procedure. 'dbo' is a forbidden value for the login name parameter in this procedure."

In my case, I checked the user properties, and the bad map was gone. I was able to continue after this fix and drop the login.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search