I am getting the following error after importing a database schema (from both SQL 2000 and SQL 2005):
"The login already has an account under a different user name"
The error points to the generated SQL script for the user under the security folder.
Anybody able to explain to me the meaning and cause of this error
Thanks

Cause of this error: "The login already has an account under a different user name"
Jason Seel
Steve,
You are right. The login ID of the user was mapped to the "dbo" user in the database. That is what was causing the error.
Do you have any suggestion on how to work around this
Thanks
dagfari
I just had at similar problem installing the database for SCCM.
The computer account for the SCCM server had an other login at the SQL server.
I solved the problem using the following commands:
Use Master
Select * from master.sys.server_principals
Drop Login ["OldLoginName"]
Will Riley
Hi
can you provide more information on the user name, is this a standard SQL user that you are trying ot create
mairead
PM, TS Data
jrb1
The only thing that comes to mind is updating the post-deployment script to add the desired login. Is that a workable solution for you I'll let the team know we've got more people bumping into this issue.
thanks,
Bartvh
I encountered the same codition, but with a different resolution.
SOME-HOW the user group in the database in the restored database was called "SQLAccessGroup {06ab0134-8bbe-40d5-b293-379fe506c4a6}" and it was associated with the login ID "AGF-TEST\SQLAccessGroup {06ab0134-8bbe-40d5-b293-379fe506c4a6}". Subtle difference, but did you catch it The "AGF-Test\" prefix isn't on the User but it is on the Login.
if not exists (select * from sysusers where name = 'AGF-TEST\SQLAccessGroup {06ab0134-8bbe-40d5-b293-379fe506c4a6}') exec sp_grantdbaccess [AGF-TEST\SQLAccessGroup {06ab0134-8bbe-40d5-b293-379fe506c4a6}]
Edge Of Zero
KS2006 -
Is the user in question a member of the sysadmin role I know that the error will occur when you try to add yourself this way, because the user is the owner of the design-time validation database, and as dbo, they already exist. But I'd only seen this error when someone tries to add themselves as a user, not when they're adding someone else.
Sreekk
Hi,
I deleted ALL the users from my VS DB project (I mean there is no files in the folder Users, also there is no text in pre- and post- deployment scripts)
And despite this fact I'm getting the same error.
I tried to look deeper into the matter and compared the schemas of the project and the DB to which I had unsucessfully tried to deploy it, and this is what I discovered:
For some reasons, during the deployment the VS tries to create a new user which has MY windows account, i.e. it tries to execute lines like so:
IF NOT EXISTS
(SELECT * FROM master.dbo.syslogins WHERE loginname = N'DOMAIN-282D649\Login')CREATE
LOGIN [DOMAIN-282D649\Login] FROM WINDOWSGO
CREATE USER
[DOMAIN-282D649\Login] FOR LOGIN [DOMAIN-282D649\Login] WITH DEFAULT_SCHEMA=[dbo]GRANT CONNECT TO
[DOMAIN-282D649\Login]GO
* DOMAIN - my domain, Login - my login
So, I'm out of ideas as to why on earth it does so, I have not been able to find any settings which would allow me to switch it off. I'm stuck
Could you suggest the way out, please
Demix
User name is an active directory user (it's of the form DOMAIN\USERID). This is an error that appears in the "Error List" windows in VS 2005 right after a schema import.