1,Code:
UseMaster
restore database database name from disk = 'C:/dbname. bak' with replace
Or:
Restore and modify the database path:
RestoreDatabaseDatabase Name
FromDisk='C:/dbname. Bak'
with move 'test' to 'C: "Program Files" Microsoft SQL Server "MSSQL" data "test. MDF ' ,
Move'Test _ Log'To'C: "Program Files" Microsoft SQL Server "MSSQL" data "'Test_log.LDF'
2,Enterprise Manager:
Operations in Enterprise Manager:
Enterprise Manager -- right-click " database " -- all tasks -- restore a database
--"Restore to database"Enter the restored Database Name
-- Restore Selection " Slave Device "-- Select a device -- Add -- Add your backup file -- OK , Return to the database restoration page.
-- options -- set " move to physical file name " to the file name of your data file
--If the database to be restored already exists,Select"Force restore on existing database"-
-OK
ArticleSource: http://topic.csdn.net/t/20031217/17/2574348.html