Login Failed - Login already has an account under a different user name

  • Hi I'm new to SQL Admin.

    Have 2 databases that need login to be db_DataReader, db_DataWriter, & db_DDLAdmin. I created the user under the general SQL security (Using SSMS). User added ok. I opened up 1 database - security and want to add login to that. Right Click - New User - Enter User Name, Login Name, Assign Roles, OK. Now get an error:

    Create failed for User... The login already has an account under a different user name. 15063

    Did this same routine for 3 other logins and it worked fine. Using SQL server 2005.

    Jess

  • Here is the answer:

    The login already has an account under a different user name.

    Check users, mapped to the database - one of them mapped from your login.

  • Or Query sys.SQL_logins table.

    -Forum Etiquette: How to post Performance Problems[/url]

    -Forum Etiquette: How to post data/code to get the best help [/url]

  • Ok Grasshopper - I'm really new so I ran this script

    select l.loginname as [login name],u.name as from sysusers u inner join master..syslogins l on u.sid=l.sid

    And the results show

    login name user name

    sa dbo

    SQL\SQLServer2005MSFTEUser$SQL$MSSQLSERVER

    ##MS_AgentSigningCertificate##

    Domain\SC1$

    So what do I do now?

  • You are running your script against the master database, but you have to run it against your particular database.

    Please do it and show the results.

  • Really new here - can you send over the script for this?

  • I ran this

    select 'databasename', l.loginname as [login name],u.name as from DatabaseName..sysusers u inner join master..syslogins l

    on u.sid=l.sid

    And got this:

    Login Name - User Name

    DomainName\Sharepoint-Read - DomainName\Sharepoint-Read

    DomainName\Sharepoint-Search - DomainName\Sharepoint-Search

    DomainName\Sharepoint-Admin - DomainName\Sharepoint-Admin

    DomainName\Sharepoint-Services - dbo

    The problem is with DomainName\Sharepoint-Services -

    I tried to go into the General SQL Security and change the user mappings but it wouldn't take.

  • Ok, I see your problem.

    The login was mapped to the database as the dbo, which is wrong. It happened because this account actually created a database during the installation.

    Please run the script against your database:

    sp_changedbowner 'sa'

    Then just re-map your login DomainName\Sharepoint-Services to the database (double click on the login->User Mapping->check your DB->check Datareader/Datawriter->Ok)

  • Thanks - that worked.

    JS

  • Thank you for solution

Viewing 10 posts - 1 through 9 (of 9 total)

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