Results 1 to 5 of 5

Thread: Error 21776: SQL-DMO The name ' greg' was not found in Users collection

  1. #1
    Join Date
    Oct 2002
    Posts
    92

    Error 21776: SQL-DMO The name ' greg' was not found in Users collection

    I know why Im getting this msg, I restored a dbase from another server...so there is an orphan in the syslogin tables..is the solution below ok to do ?..and if so, do I re-enter user in the syssusers table or in EM ?

    any other suggestions without touching the sysusers table would be appreciated as well

    thank you




    "In EM, Server Properties, turn on "Allow modifications to be done directly to the system catalogs"
    - Delete the user from "sysusers"
    - Re enter the user granting it the correct access to the database
    - Turn off "Allow modifications to be ....."

  2. #2
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    No you cant do that without touching sysuser table (you can update sysxlogins. I dont recommend it. If you mess up, you need update your resume)

    This is what I do (using script. I dont believe in EM that much and too many clicks).


    use master
    go
    sp_configure "allow updates",1
    go
    reconfigure with override
    go
    use databasename
    go
    update sysusers set sid = (select sid from master.dbo.syslogins where name = 'Loginname') where name = 'Loginname'
    go
    use master
    go
    sp_configure "allow updates",0
    go
    reconfigure with override
    go

  3. #3
    Join Date
    Sep 2002
    Posts
    5,938
    Or just remap it to sql login with sp_change_users_login.

  4. #4
    Join Date
    Oct 2002
    Posts
    92
    Mak,
    with the query of
    "update sysusers set sid = (select sid from master.dbo.syslogins where name = 'Loginname') where name = 'Loginname"

    I see that the sid in the syslogins table for 'greg' is 'binary' and 'greg' name is not currently found in the sysusers table....would your solution still work ?

  5. #5
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    no.

    use databasename
    go
    sp_adduser 'greg'
    go


    then my script

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •