Some times SQL Server log files acquire a large space on disk. In that case we need to reduce the size of log file to claim some space. But truncating or reducing database log file in SQL Server 2008 can be quite difficult. It also have its own issues.
This article contains a set of commands to Shrink Log Files of SQL Server database.
Step 1. Check Database Log Filename
First check the actual name of log files stored in sql server records using following sql query. Execute these queries in using SQL Server management studio query browser.
mydb; GO SELECT FILE_NAME(2); GO
Above command will show name of log file, Use that name in step 2 query, in place of LOG_FILE_NAME.
Step 2: Shrink Log File
After getting the name of log file, you can use following sql queries to shrink the files.
mydbGO Alter Database mydbSet Recovery Simple GO DBCC SHRINKFILE (' LOG_FILE_NAME', 1000) GO Alter Database mydbSet Recovery Full GO
Now check the size of log files, I hope you will get the expected results.