| Author |
Message |
mrn242
Joined: 30 Aug 2010 Posts: 2
|
Posted: Fri Oct 15, 2010 4:14 pm Post subject: Can Backup 5 restore to new database? |
|
|
| Is there a way to restore to a new - or even a different - database using SQL Backup 5? |
|
| Back to top |
|
 |
petey
Joined: 24 Apr 2005 Posts: 2218
|
Posted: Sat Oct 16, 2010 4:28 am Post subject: |
|
|
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 |
|
 |
|
|
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