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
 General SQL Server Forums
 New to SQL Server Administration
 transact sql backup and restore

Author  Topic 

mvanwyk
Yak Posting Veteran

99 Posts

Posted - 2009-10-13 : 05:24:53
Hi Guys can someone please assist me.

I have a SQL 2005 Job called BackupAndRestore

That basically backups a DB and restores it over another DB.

Step 1
BACKUP DATABASE DBParent TO DBParentDataDEV
GO
Step 2
BACKUP LOG DBParent
TO DBParentLogDEV
Step 3
RESTORE DATABASE DBChild
FROM DBParentDataDEV
WITH REPLACE

Please note that i'm restoring the backup of the Parent DB over the Child DB.

This fails on step 3 with no error information.

Both the Data and the log file are present after step 1 and 2.

What am i doing wrong here.

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2009-10-13 : 06:11:41
quote:

This fails on step 3 with no error information.



Did you check the SQL Errorlog?
Are you running these commands in SSMS, or command line/batch?
Go to Top of Page

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2009-10-13 : 06:11:51
You probably need WITH MOVE for the physical file locations.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-10-13 : 13:18:07
Posting the error is always helpful, but I agree you'll need the WITH MOVE option to correct this.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -