Wednesday, March 28, 2012

Problem restoring database ...

Dear Newsgroup,

I am using sql server 2000 over win 2000 server with service pack 4.

I have been given a back up of a database (I have tried both from T-SQL and
Enterprise Manager)

T-SQL

RESTORE FILELISTONLY
FROM DISK = 'c:\A.bck'

RESTORE DATABASE B
FROM DISK = 'c:\A.bck'
WITH MOVE 'A_Data' TO 'c:\test\B.mdf',
MOVE 'A_Log' TO 'c:\test\B.ldf'

and as I try to restore I get the following error :

Server: Msg 3154, Level 16, State 2, Line 1
The backup set holds a backup of a database other than the existing 'B'
database.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.

Would you kindly help me ?????

Thank you in advance,
YassYass (gol_e_yass@.yahoo.com) writes:
> RESTORE FILELISTONLY
> FROM DISK = 'c:\A.bck'
> RESTORE DATABASE B
> FROM DISK = 'c:\A.bck'
> WITH MOVE 'A_Data' TO 'c:\test\B.mdf',
> MOVE 'A_Log' TO 'c:\test\B.ldf'
> and as I try to restore I get the following error :
> Server: Msg 3154, Level 16, State 2, Line 1
> The backup set holds a backup of a database other than the existing 'B'
> database.
> Server: Msg 3013, Level 16, State 1, Line 1
> RESTORE DATABASE is terminating abnormally.
> Would you kindly help me ?????

I'm out on a limb here, but my interpretation is that there is already
a database B on the machine, but the backup is taken from another
database (A?). Adding ", REPLACE" at the end will get rid of the
error message - and wipe out B, so be careful that this is what you
want to do.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

No comments:

Post a Comment