September 16, 2009 at 6:24 am
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
September 16, 2009 at 6:32 am
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.
September 16, 2009 at 6:43 am
September 16, 2009 at 6:56 am
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?
September 16, 2009 at 7:07 am
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.
September 16, 2009 at 7:24 am
Really new here - can you send over the script for this?
September 16, 2009 at 7:49 am
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.
September 16, 2009 at 8:16 am
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)
September 16, 2009 at 10:42 am
Thanks - that worked.
JS
September 3, 2015 at 2:56 am
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