Hi
From time to time we all need to clear up dev server, truncate the log-file and resize the bloated LDF file of the SQL Server.
How to do it?
Suppose the name of the database is Vikram
First we make the server truncate the log the next time it runs the checkpoint.
EXEC sp_dboption 'Vikram', 'trunc. log on chkpt.', 'TRUE'
Now force a check point for the database
CHECKPOINT
Now we are ready to shrink the database or transaction file or whatever.
DBCC SHRINKFILE (Vikram_Log, 200)
Now we are ready to SHRINK the database or transaction file or whatever
DBCC SHRINKFILE (Vikram_Log, 200)
And last but not the least important
Go to Enterprise manager & make sure you restrict the file size of the database
Hope this helps
Thanks
Vikram