.Net ramblings
# Sunday, 11 January 2009
SQL 2005 cannot drop user with owned schema
i notice when i backup a database and restore it to another server, the user IDs are different and i have to delete the users and add them back in to the database.  however last time i tried this the drop failed because the user owned a schema.  i right-clicked on the user's properties and the tick box for 'db_owner' was shaded in a read only state.  so i couldn't delete the user and couldn't remove their schema ownership.  took a while to figure out that the way to do this is via the Database > Security > Schemas menu, then change the schema owner back to itself, e.g. db_owner.  then the user is free to be deleted.


Sunday, 11 January 2009 15:28:04 (GMT Standard Time, UTC+00:00)  #    Comments [2]  Database

Sunday, 02 August 2009 01:38:19 (GMT Daylight Time, UTC+01:00)
Thank you so much! I was having the same problem and I was about to go crazy! Your post here saved me hours of pain.
Henry
Monday, 30 January 2012 21:18:56 (GMT Standard Time, UTC+00:00)
Thanks. It helps me too.
Alex
OpenID
Please login with either your OpenID above, or your details below.
Name
E-mail
Home page

Comment (Some html is allowed: a@href@title, strike) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

[Captcha]Enter the code shown (prevents robots):

Live Comment Preview