Attach mdf file without ldf file in Database
Please execute the following statement from sql server management studioCREATE DATABASE TestMyDb ON
(FILENAME =N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQL2008R2EXPRESS\MSSQL\DATA\TestMyDb.mdf')
FOR ATTACH_REBUILD_LOG
GO
Please note:-
Where TestMyDb is the mdf file
And keep the file in the default location of the sql server.