SQL Server 2005: How to Attach (or Reattach) a Database Missing the LDF

Posted November 20, 2006 by Rob Rogers in Database

If you need to attach a database that has no log file (.LDF), or have deleted the log file because it was too big and need to reattach the database, SQL Server 2005 does allow you to do this. You can attach the database by following this Tech-Recipe:


1. Open the SQL Server Management Studio and connect to the desired server.

2. Right-click on Databases and select Attach.

3. Click the Add button and select the database file to be attached.

4. Under database details, select the .LDF file and click the Remove button.

5. Click OK.

The database will be attached with a new logfile.

 

About Rob Rogers

Once a prolific author here on Tech-Recipes, Rob has moved on to greener pastures.
View more articles by Rob Rogers

The Conversation

Follow the reactions below and share your own thoughts.