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 Programming
 Multiple file restore

Author  Topic 

GRAYWOLF
Posting Yak Master

106 Posts

Posted - 2009-03-13 : 02:44:04
When restoring a DB with multiple data or log files to a different server, what is the correct syntax for the MOVE statements for the multiple files?

---------------------------

Working until "the morning sun sets the midnight sky on fire"!

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-03-13 : 07:45:47
[code]RESTORE DATABASE DBNAME FROM DISK = 'Path' WITH FILE = 1,
MOVE 'MDF file' TO 'New location',
MOVE 'Log file' TO 'New location',
MOVE 'Log file2' TO 'New location'
MOVE 'NDF file' TO 'New location',
MOVE 'NDF file' TO 'New location,
MOVE 'NDF file' TO 'New location',
MOVE ..........
NOUNLOAD, STATS = 10
GO[/code]
Go to Top of Page

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2009-03-13 : 10:24:24
Check this script...it will generate the code for you:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=101995

- Lumbago
Go to Top of Page
   

- Advertisement -