USE master GO -- First determine the number and names of the files in the backup. -- AdventureWorks_Backup is the name of the backup device. RESTORE FILELISTONLY FROM AdventureWorks_Backup -- Restore the files for MyAdvWorks. RESTORE DATABASE MyAdvWorks FROM AdventureWorks_Backup WITH RECOVERY, MOVE 'AdventureWorks_Data' TO 'D:\MyData\MyAdvWorks_Data.mdf', MOVE 'AdventureWorks_Log' TO 'F:\MyLog\MyAdvWorks_Log.ldf' GO
GO
-- First determine the number and names of the files in the backup.
-- AdventureWorks_Backup is the name of the backup device.
RESTORE FILELISTONLY
FROM AdventureWorks_Backup
-- Restore the files for MyAdvWorks.
RESTORE DATABASE MyAdvWorks
FROM AdventureWorks_Backup
WITH RECOVERY,
MOVE 'AdventureWorks_Data' TO 'D:\MyData\MyAdvWorks_Data.mdf',
MOVE 'AdventureWorks_Log' TO 'F:\MyLog\MyAdvWorks_Log.ldf'
GO