CREATE DATABASE 数据库名
ON (FILENAME = 'D:\test.mdf')
FOR ATTACH_REBUILD_LOG ;
GO

Related Posts: SQL Server 2008 单MDF文件恢复数据库 :