Error 21776: [SQL-DMO] The name ''dbo'' was not found in the Users collection

  • hi we recently changed our domain name. so i recreated my logins. changed owners of databases and changed owners of dts. when i used the sp_changedowner and i changed it for a new user it got changed fine. but when i go to the security folder and go to the user , go to the database tab , i see it says 'dbo' i click on it i get the error message below...

    database owner (dbo) user in a user database is not listed in the Users folder in Enterprise Manager. Additionally, when you view the properties of any login in the Logins folder in Enterprise Manager, i receive the following error message:

    Error 21776: [SQL-DMO] The name 'dbo' was not found in the Users collection. If the name is a qualified name, use [] to separate various parts of the name, and try again.
     
     
    for now i did
    exec sp_changedbowner 'sa'
    but i don't want sa to be the owner of all my databases....
     
    any help would be greatly apreciate it!!!
  • I had the similar situation. I tried two approaches. One is the same as yours, change the ownership to sa, then change it to my desired ownership. Another is drop the user/login, recreate it, then, assign the ownership. None of them was pleasant.

  • use exec sp_changedbowner 'sa', true.

    Keep in mind this is one of the flaws of EM. You'll have to disconnect an reconnect to see the correct results.

     

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • I have run into this when you have account issues which are changed...the SID's don't match and you get an error like yours above.  As my Boss would say Enterprise Mangler or my personal favorite Enterprise Damager caches information to improve speed.  However when you make a change it doesn't always update the cache which leads to the post above mine, and you receive the error message.

     

    Make the change to reflect the correct dbo for the database, disconnect and reconnect with EM...it should reflect the changes then and you can stop beating your head against the wall.

     

    Hope this helps...

  • Thank you guys!!! i am glad i was in the right track..

    question i added the sa as a owner for a database, so when i right click on properties at EM sa comes out as the owner. however when i look at the tables of the database sysdba comes out as the owner and i check on the properties of the sysdba and it does come out as the owner also of the db...  i don't think that is correct, am i right?

  • I guess that's what the "true" parameter is for in

    use exec sp_changedbowner 'sa', true.

    You can use sp_changeobjectowner @objname 'oldowner.object' , @newowner 'newowner'

     

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • that sounds like a crm app I sadly have encountered a couple of times that insists in having objects owned by non dbo.

    To be honest dbs owned by sa ( unless you've removed sa ) is the safest and objects always owned by dbo.  Databases owned by users, same as objects, not always a good idea.

    [font="Comic Sans MS"]The GrumpyOldDBA[/font]
    www.grumpyolddba.co.uk
    http://sqlblogcasts.com/blogs/grumpyolddba/

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply