Restore or Attach Database Without Log File – SQL in Sixty Seconds #082

One of the most common question I get on blog is – how do I attach database without log file. I have previously blogged about it over here. I request you to read this blog post if you want a solution where you can learn how to attach database to SQL Server with the help of T-SQL.

SQL in Sixty Seconds title slide.

SQL SERVER – Attach mdf file without ldf file in Database

In today’s video blog post we will see how we can attach any database without log file to SQL Server.

I always wondered what is the common scenario when user need to do this particular operation. What would be the reason for attaching an only MDF file and not LDF file to the database? Well, after talking to quite a many users, I figured out there are three primary reasons for it.

  • Lots of people do not know that log file contains important transaction data and it is needed.
  • There are instances where the log file got so big and user never cared for its content and size. When they want to move the database to another instance, they would just want the MDF file to be moved to a different instance.
  • Log file got corrupted due to hardware failure.

Well, it does not matter which reason you are facing. You can always use the method displayed in the quick video to restore your database.

Published by Pinal Dave on SQLAuthority. More of my work at pinaldave.com.


Discover more from SQL Authority with Pinal Dave

Subscribe to get the latest posts sent to your email.

SQL in Sixty Seconds, SQL Server, SQL Server Management Studio, Transaction Log
Previous Post
Install SQL Server 2016 Sample Database WideWorldImporters – SQL in Sixty Seconds #081
Next Post
GroupBy Conference – 3 Common Mistakes to Kill SQL Server Performance

Related Posts

4 Comments. Leave new

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.