Add a User in SQL Server



  • Theresa Gorman

    We have migrated to a new server.  I am unable to create usiadmin to the security logins to map to restored database as it says user already exists

  • Sean Tame

    HI Theresa,

    You need to delete the user from within the DB Security itself, then add it under the Security folder at the Server level, then enable it on the DB.

    Shout if you need help.

  • Sara Noonan

    Hi Theresa, just poking my head in to second Sean's answer.  Thanks!

  • Theresa Gorman

    Thanks guys, I had done that but it would still not map.  I found a script to do it

    ALTER USER <user_name> WITH Login = <login_name>;

  • Lee Tickett (Tickett Enterprises Limited)

    The process I have always used is to create the login (at server level) without mapping to the database.

    Then run this to fix/attach to the db user;

    sp_change_users_login 'AutoFix', 'usiadmin'

Please sign in to leave a comment.