SQL Server 2005: How to Attach (or Reattach) a Database Missing the LDF
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.








Veronika said on October 3, 2008
thx a lot :)
foo said on December 16, 2008
Thanks buddy, it really helped me. :)
Walter Franco said on December 19, 2008
Hi,
I did exactly like this last month, but my database doesn´t update the log file, it stays at the same old date when i attached and only update if i restart the SQL services. Is that “normal” or I missed something?
Txs for any help!
Walter Franco
Poços de Caldas – MG
Brasil
Mayur said on March 12, 2009
Hello
i have one problem
plz give me solution
i want to attach script to the database of the microsoft sqlserver 2005 databse
plz give me suggetion about this topic
what to do for that
thnkyu in advance
msolih said on June 5, 2009
before attach, rename your LDF file first.
Kopi said on August 24, 2009
eey dawg u on point, hommie, nearly died of a heart attack, u a great deal dawg, kip it real!!!!
niranajn said on May 20, 2010
good
niranajn said on May 20, 2010
excallent
Shikhavalecha said on September 3, 2010
thanks alot
Karthika said on October 8, 2010
i am new to sql, my bd is perfect now
AusNetIT Solutions said on May 2, 2011
Hi,
Can we do this on SQL 2000?
Thanks,
mony said on November 10, 2011
very good
thanks