Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Restoring a backup A to database B 1

Status
Not open for further replies.

gunsva

Technical User
Aug 23, 2001
6
US
I have a backup of a database 'A'. Have created a new database 'B'. I need to restore the backup 'A' to database 'B'.

When I try this from Enterprise Manager, I get some errors.

I also need to achieve the above via a RESTORE script. Any advice is appreciated a lot !
 

Can't help you with the Enterprise Manager errors if I don't know what they are. You can restore from database A backup to database B using EM. I do it all the time. Post the errors and someone may be able to help resolve the problem.

SQL BOL gives the following example of restoring a database to a different nameed DB using T-SQL.

USE master
GO
-- First determine the number and names of the files in the backup.
-- MyNwind_2 is the name of the backup device.
-- This is an optional step if you don't know the backup file name.
RESTORE FILELISTONLY
FROM MyNwind_2
-- Restore the files for MyNwind2_Test.
RESTORE DATABASE MyNwind2_Test
FROM MyNwind_2
WITH RECOVERY,
MOVE 'MyNwind2_data' TO 'D:\MyData\MyNwind2_Test_data.mdf',
MOVE 'MyNwind2_log' TO 'D:\MyData\MyNwind2_Test_log.ldf'
GO

For more information search for RESTORE in SQL BOL. Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it and comment if you have time.
NOTE: Reference to the FAQ is part of my signature and is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top