Well guys, i just had the pleasure of deleting the LDF database file for my WSS 3.0 dev site.

Why? The server had literally 0.99MB of hard disk space and out of desperation, i deleted the 7GB log file by stopping the sql service and deleting the LDF file – i know, i wasn’t thinking straight…

Anyway, SQL went into a heap.. I couldn’t detach the database so i could re-attach it and re-create the logs..

The error was: It couldn’t find the log file so it couldn’t detach <- i mean how stupid is that…

Anyway, after fanning around, i uninstalled WSS3.0 and restarted the server.

Logged into SQL management studio, started a new Query and ran the following;

USE [master]
GO
CREATE DATABASE [SharePointTEST] ON
(FILENAME = N'D:\Path\To\Sharepoint\ConfigDB.mdf')
FOR ATTACH_REBUILD_LOG
GO

 Now, the other database has detached itself and the new database SharePointTest is up and working with a LDF file.

My main concern now was will WSS 3.0 install and connect to an existing database? is it smart enough?

I managed to install WSS as usuall (stand alone server), then i went to Central Administration and it said none had been configured so hit next and to my amazement it configured it and launched sharepoint and boom i was back to my old sharepoint site.

Fantastic huh!