SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Cannot Drop the User DBO


Cannot Drop the User DBO

Author
Message
diane.payne
diane.payne
SSC Rookie
SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)

Group: General Forum Members
Points: 28 Visits: 97
I'm trying to remove a user that is a dbo on several databases on an instance of SQL 2005. When I try to delete the user it give me the error "Login 'RptAdmin' owns one or more database(s). Change the owner of the database(s) before dropping the login. (Microsoft SQL Server, Error: 15174)"

The odd thing is that when I look at the dbo user under the security of the database it shows the user name is dbo but the login name as RptAdmin. Any suggestions on how I can remove the RptAdmin login or take away the dbo rights to a database so I can delete the login?

Thanks!
schep021
schep021
SSC Eights!
SSC Eights! (836 reputation)SSC Eights! (836 reputation)SSC Eights! (836 reputation)SSC Eights! (836 reputation)SSC Eights! (836 reputation)SSC Eights! (836 reputation)SSC Eights! (836 reputation)SSC Eights! (836 reputation)

Group: General Forum Members
Points: 836 Visits: 770
diane.payne (8/3/2009)
I'm trying to remove a user that is a dbo on several databases on an instance of SQL 2005. When I try to delete the user it give me the error "Login 'RptAdmin' owns one or more database(s). Change the owner of the database(s) before dropping the login. (Microsoft SQL Server, Error: 15174)"

The odd thing is that when I look at the dbo user under the security of the database it shows the user name is dbo but the login name as RptAdmin. Any suggestions on how I can remove the RptAdmin login or take away the dbo rights to a database so I can delete the login?

Thanks!


You can use sp_changedbowner to change the owner of the db to a login other than RptAdmin. Here is an example to change the owner to sa on the current database.

sp_changedbowner 'sa'

You can test this on a "test" server to make sure it is giving you what you desire.

The security you see with login as RptAdmin and user as dbo is normal. Smile

Hope this helps!
diane.payne
diane.payne
SSC Rookie
SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)

Group: General Forum Members
Points: 28 Visits: 97
I am a novice with sql databases, but I am learning very quickly.

Would the fact that "dbo" is the user and login name is "RptAdmin" become a problem when communicating between a reporting server and the database server?

Thanks for your assistance!!
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