How can i attach my database.mdf file without adding its .ldf file in SQL Server?

I am trying to attach my database.mdf file in my SQL Server 2014, but getting connection error. Is it possible to attach the master database file in SQL Server without attaching its associated .ldf file?
If yes, So what are the steps?

Have you looked into using sp_attach_single_file_db to perform the attach? BOL has details. It works when there is only a single data file.

Another option would be the CREATE DATABASE...ATTACH or ATTACH_REBUILD_LOG option. I can't say this is the option for you but it bears looking at.

1 Like