User/Login already exists for new DB

  • I just created a new database (SQLServer 2K)

    I attempted to add an existing user to this DB.

    Got this error: 15023 user or role already exists

    The current user is already a db owner on 2 other dbs

    no role, however.

    any ideas ?

    Thank you

     

  • Here is what I usually do when I got that type of error.

    Try

    EXEC sp_revokedbaccess 'Corporate\GeorgeW'if the user own objects, you would have to change ownership of that table,view,stored proc ... to dbo and then try the above command again.  Once successful, you can re-try to add this person as a user for that database again.
     
    mom
     

  • Was this DB restored from another server in any manner?

     

    If so look at

     

    sp_change_users_login

     

    in BOL and that should help with the UPDATE_ONE action.

  • Following on from Antares686,

    Go onto the database and run this:

    SELECT * FROM sysusers WHERE name = 'thename'

    If it exists, you can then delete it, but only if you check the relevent box in the server properties.

     


    Yes I would like a banana,

    Mr Shouty

  • How did you attempt to add the user?

    I'm guessing you might have tried to create a new user instead of GRANTing access to the database to the existing user.

    -SQLBill

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

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