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