Add User Mapping not working

  • I'm trying to add a user mapping to an already existing login. In the Login Properties for the login, I need to add another database, so I check it and enter the User and Default Schema. When I click OK, it gives me an error 15023 saying that the user already exists. It's supposed to already exist, I'm just adding a User Mapping to this login. Help?

  • does the user is already added in the particular db??

    Regards
    Sushant Kumar
    MCTS,MCP

  • User mapping in the GUI attempts to create the user in the database you're trying to map to, thus the error you got.

    Use sp_change_users_login to remap the existing database user to the existing login.

    example: sp_change_users_login 'update_one', 'username', 'loginname'

    Greg

  • I think some users got orphan.

    exec sp_change_users_login 'REPORT'

    --( run in every database to see which all logins got orphan)

    Regards,

    Sushant

    Regards
    Sushant Kumar
    MCTS,MCP

  • Thanks guys, that did the trick...

  • if there is login exist then delete and add login to corresponding user.

  • Hello,

    sp_change_users_login will update the users, why do have to delete and update for each DB.

    Note this is a old thread.

    Regards
    Durai Nagarajan

  • go Database name => security =>users then delete the user.

    Add new user..

    Any Problem .Let me know.

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

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