--Returns a result set consisting of a list of databases and log files contained in the backup set.
--Get the logical file name mainly
Restore FILELISTONLY from disk = ' E:/levws.bak '
/*
Recover the database with Bak, Force restore (REPLACE)
STATS = 10 Displays one record per completion 10%
Dbtest and Dbtest_log are above g:\back. The logical file in Bak
*/
Copy Code code as follows:
Use master
RESTORE DATABASE Levws
From DISK = ' E:\levws.bak '
With move ' levws_data ' to ' E:\levws_Data.MDF ',
Move ' levws_log ' to ' E:\levws_Log.LDF ',
STATS = ten, REPLACE
Go
Results:
374352 pages have been processed for the database ' Levws ', file ' Levws_data ' (located on file 1).
1 pages have been processed for the database ' Levws ', file ' Levws_log ' (located on file 1).
Converting database ' Levws ' from version 539 to current version 655.
The RESTORE DATABASE successfully processed 374353 pages, costing 205.725 seconds (14.216 MB/s).