Let’s say…one of your DB log file got too large and u need to make some space in your hard disk very quickly. So, u like to delete a .ldf file/log file of a database of MS SQL server. First, you need to close any SQL server client tool that is running (i.e. SQL Server Management Studio), then go to “control panel -> Administratice tools -> Services. Then stop SQL Server. Now u can go to the data directory of your SQL server (default directory is C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2K8\MSSQL\DATA) and delete the desired .ldf file.
Now, if u restart the stopped service and start SQL server management studio, you will find that the affected DB is showing up in the list, but u cannot browse it or make any query against it. What you have to do now is,
SELECT DATABASEPROPERTY(‘your_db_name’, ‘isShutdown’) –if this returns 1, proceed to next steps
ALTER DATABASE your_db_name SET OFFLINE
Now, your affected database will be up and running again with a new log file.