SQL Server error 15063, “This login already has an account under a different username

  • I keep getting a SQL Server error 15063, “This login already has an account under a different username”, when trying to add an Active Directory account as a user in a particular database.

    I had a job that was failing and I wanted to execute the job using a windows account. On the "Job Step Properties" under "Advanced" you can create an output file and run as a user that you select from user in that particular database. I tried to add a user to the database and get the above error. The user I am trying to add is a Sysadmin user that already has this particular database checked in it's user mappings.

    When I go to the "Login Properties" Page where all the databases listed for this user I see the database name I am interested in with the "Map" column checked and under the "User" and "Default Schema" I see dbo. I know I can change the user to the user I am interested in but I do not know the ramifications of that change or if it will fix my problem of adding this user to the database I am interested in.

    I have looked on-line but not found anything that can help me with an understanding of how the Login Properties page works or how to accomplish what I really want and that is to add this user to this particular database...

    Any help or guidance will be greatly appreciated

  • This is because the user is already exist in the database, go ahead and drop the user from the database and create login it shouldn't cause any problem. Is this user mapped to any login?

    EnjoY!
  • its possible the user already exists in the database and is orphaned.

    --*********** REPORT ON ORPHANED USERS PER DATABASE

    EXEC SP_CHANGE_USERS_LOGIN REPORT

    --*********** CREATE LOGIN AND CHANGE @USER TO THE SAME. THIS WILL REMAP USER TO LOGIN

    EXEC SP_CHANGE_USERS_LOGIN 'Auto_Fix', 'db_user'

    would remap user to login.

Viewing 3 posts - 1 through 2 (of 2 total)

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