SQLTeam.com | Weblogs | Forums

Shrink the log file in a desired size



How to shrink log file to desired size? Can you please post the script to do that for sql 2000. My log file is 8gb but less than 0.5gb is being used..i need to shrink the file to 750mb. Could you please help me how can i do this?


you can simply use dbcc shrinkfile (, 750)

keep in mind that you will only shrink log file if you are sure that its not growth by any batch process or regular process. Otherwise it will just growth back to 8Gb as it you see now. Check your index maintenance job as most likely that might be the one that cause the growth of log.


Remember to do a log backup/database backup before any attempt at shrinking.

Also is this SQL Server 2008 or SQL Server 2000 as stated in the question?


USE [your_db_name]