Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 The login already has an account under a different

Author  Topic 

TMDOSS
Starting Member

33 Posts

Posted - 2010-02-22 : 13:32:06
I'm trying to copy the database. I'm using the copy database from the task manager. If fails for the following reason.

description=Executing the query "CREATE USER [winadmin] FOR LOGIN [test\winadmin] WITH DEFAULT_SCHEMA=[winadmin] "
failed with the following error: "The login already has an account under a different user name.".
Possible failure reasons: Problems with the query<c/> "ResultSet" property not set correctly<c/> parameters not set correctly<c/>
or connection not established correctly. helpFile= helpContext=0 idofInterfaceWithError={8BDFE893-E9D8-4D23-9739-DA807BCDC2AC}
StackTrace: at Microsoft.... The package execution fa... The step failed.,00:09:54,0,0,,,,0

Pl help

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-02-22 : 15:11:37
there is already a user in the target database mapped to that login. are you copying a user database or master? database already exists on target server? is login part of AD group that has been granted access?
Go to Top of Page

TMDOSS
Starting Member

33 Posts

Posted - 2010-02-22 : 15:30:52
No I'm just trying to copy the Database in the same server. not master database. it's Production database to test database in the same server. Product database name: Prod Test database name : test(I have given this name in the Task manager when asked for the database name)
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-02-22 : 16:30:18
I'd just restore a backup then to a different name, using the WITH MOVE option to specify new filenames.

something like this
RESTORE DATABASE newDB FROM disk = '\\pathToBakupFile\old.bak'
WITH
Move 'old_data' to 'd:\sql\new.mdf'.
MOVE 'old_log' to 'e:\sql\new.ldf',
STATS;
GO
Go to Top of Page
   

- Advertisement -