1: 無需新建數據庫,直接運行
USE master;
GO
CREATE DATABASE test
ON (FILENAME = 'D:Program FilesMicrosoft SQL ServerMSSQL10.MSSQLSERVERMSSQLDATAtest.mdf'),
(FILENAME = 'D:Program FilesMicrosoft SQL ServerMSSQL10.MSSQLSERVERMSSQLDATAtest_log.ldf')
FOR ATTACH;
GO
如需其它文件,復制到相應位置即可
2: 刷新下就會出來