How to reset the Log File in SQL Server Management Studio

Introduction

This topic explains the process of removing the IRIS_log.ldf file should it's size start causing HDD space problems.

  1. Click on Start on the bottom left corner of the screen (desktop).

  2. Highlight All Programs and select Microsoft SQL Server 2008 R2, then SQL Server Management Studio.

  1. Make sure the Server name\ instance is correct and click Connect.

  1. Click on the + next to Databases to expand:

  1. Select and right-click on IRIS and select Tasks | Detach

  1. Click OK.

  1. Go to the Local Disk (C:\) and locate the database, for example:

\Program Files\MicrosoftSQLServer\MSSQL10_50.IRISPRACTICE\MSSQL\DATA

  1. Click on IRIS_log.ldf, right-click and select cut and go back one step to Backup folder and paste.

          

 

  1. In SQL Server Management Studio, right-click on Databases and select Attach.

  1. Click Add then select IRIS.mdf and click OK.

  1. In the “IRIS” database details section, select IRIS_log.LDF to highlight it and click Remove.

  2. Click OK.

  1. Check the file size in the Program Files\MicrosoftSQLServer\MSSQL10_50.IRISPRACTICE\MSSQL\DATA

  2. Make sure database is set to Simple Recovery Model.

    1. Right-click on database name and select Properties.

    2. Go to the Options page.

    3. Under Recovery model select Simple.

    4. Click OK to save.