Error21776: The name dbo was not found in the users collection

  • I clicked 'sa' from security-login in a SS 7.0 database, and it shows :

    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.

    I tried to workaround the problem by using sp_changedbowner : USE PlumDB1    Exec Sp_changedbowner 'sa'

    and I received successful message.  But I still get the same [SQL-DMO] error 21776 when I tried to access 'sa'.

    Then I queried :

    Exec sp_helplogins

    and shows :

    Server: Msg 515, Level 16, State 2, Procedure sp_helplogins, Line 276

    Cannot insert the value NULL into column 'DefDBName', table 'tempdb.dbo.#tb2_PlainLogins____________________________________________________________________________________________________000100001738'; column does not allow nulls. INSERT fails.

    The statement has been terminated.

    (0 row(s) affected)

    Does someone can help me resolve the problem?  Thank you.

  • http://support.microsoft.com/default.aspx?scid=kb;en-us;305711&Product=sql2k

    Click Logins --> Refresh and try again.

     

  • I tried and have no luck so far.  When I access the 'sa' in Logins, I still get the same SQL-DMO error message said 'dbo' was not found in the users collection.

    Use sp_changedbowner to map dbo is the only way I know, do you have any other work around?  Thanks.

  • "

  • If the dbo user does have an explicit login but that user's SID in the sysusers system table does not match the login's SID in the syslogins system table (possibly due to a database restore) use the sp_change_users_login stored procedure to restore the SID mapping."
  • Have you check this?

    You may try to reinstall service pack.

     

  • I am experiencing the same problem on a number of databases on the same sql server, can you give me an example of the parameters I will need to set, using sp_change_users_login.

    I currently use sp_change_users_login 'autofix' '<username>' for orphaned users but not sure of the parameters I should be using to try and correct the above problem.

    Thanks in advance

  • Viewing 5 posts - 1 through 4 (of 4 total)

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