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.
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.
Reference: Pinal Dave (https://blog.sqlauthority.com)