Attach MDF without LDF in SQL Server

You must have observed that the sample database adventureworks comes only with a mdf file as downloadable. Se let’s see how can we attach a data file without the log file/s? Mostly when you are on the latest version of SSMS and you try to attach a mdf then the “FOR ATTACH” command gets auto generated but anyway lets have a look at all possibilities. Just a note, if you have had multiple log files for a database then you won’t be able to rebuild all ldfs except one to start the database.

Prasad Sahoo

Prasad Sahoo, is an enthusiast of Microsoft technologies in general and a passionate database professional, mainly focusing on SQL Server performance tuning and business intelligence. He has contributed a long time of his career working on SQL Server and other RDBMS. If he is not busy with SQL stuff then he must be watching some Hollywood movies.

%d bloggers like this: