Tuesday, April 21, 2009

Restore SLS Files

Run this command to find out the data file list…

 xp_restore_filelistonly @filename= '\\sql01\ProdDump\support1.sls'

 

use the same set of data files in the below script…

 

xp_restore_database @database= 'MC'

      , @filename= '\\sql01\ProdDump\support1.sls'

      , @filename= '\\sql01\ProdDump\support2.sls'

      , @with= 'stats =1'

      , @WITH= 'MOVE "SupportData1_1" to "E:\MSSQL\Q4\Support_Data1.mdf"'

      , @WITH= 'MOVE "SupportData1_2" to "F:\MSSQL\Q4\Support_Data2.ndf"'

      , @WITH= 'MOVE "SupportLog1" to "G:\Q4\Support_log1.ldf"'