Red Gate forums :: View topic - Can Backup 5 restore to new database?
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Backup Previous Versions
SQL Backup Previous Versions forum

Can Backup 5 restore to new database?

Search in SQL Backup Previous Versions forum
Post new topic   Reply to topic
Jump to:  
Author Message
mrn242



Joined: 30 Aug 2010
Posts: 2

PostPosted: Fri Oct 15, 2010 4:14 pm    Post subject: Can Backup 5 restore to new database? Reply with quote

Is there a way to restore to a new - or even a different - database using SQL Backup 5?
Back to top
View user's profile Send private message
petey



Joined: 24 Apr 2005
Posts: 2299

PostPosted: Sat Oct 16, 2010 4:28 am    Post subject: Reply with quote

Yes. If you want to use the same database files as the original database, omit the MOVE options e.g.

Code:
EXEC master..sqlbackup '-sql "RESTORE DATABASE AdventureWorks_copy FROM DISK = [g:\backups\AdventureWorks.sqb]"'

If you want to create new database files, use the MOVE options e.g.

Code:
EXEC master..sqlbackup '-sql "RESTORE DATABASE AdventureWorks_copy FROM DISK = [g:\backups\AdventureWorks.sqb] WITH MOVE [AdventureWorks_dat] TO [e:\sqldata\AdventureWorks_copy.mdf], MOVE [AdventureWorks_log] to [e:\sqldata\AdventureWorks_copy.ldf]"'

_________________
Peter Yeoh
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 7
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group