> **Possible Duplicate:**  
> [Shrinking log file](https://dba.stackexchange.com/questions/11565/shrinking-log-file)  

<!-- End of automatically inserted text -->

Some of the sql log files (idf) are hugh like 5gb. Found a article (http://extended64.com/blogs/rhoffman/archive/2009/06/11/shrink-sql-server-2008-database-log-file-script.aspx) but not sure why he repeated dbcc shrinkfile 6 times.

Can someone please confirm and suggest a clean script to do this? Thanks


    Use DatabaseName 
     GO
    Alter Database DatabaseName Set Recovery Simple
    GO
        Alter Database DatabaseName Set Recovery Full
        GO
        DBCC SHRINKFILE ('LogFileName', 1)
        GO
        DBCC SHRINKFILE ('LogFileName', 1)
       GO
       DBCC SHRINKFILE ('LogFileName', 1)
      GO
       DBCC SHRINKFILE ('LogFileName', 1)
       GO
       DBCC SHRINKFILE ('LogFileName', 1)
       GO
       DBCC SHRINKFILE ('LogFileName', 1)
       GO