title: Log file is not Shrinking on SQL Server
body: <p>I wanted to shrink the log file as much as possible by the command:</p>
  
  <pre><code>DBCC SHRINKFILE ('LogFile', 10)
  </code></pre>
  
  <p>and get this error:</p>
  
  <blockquote>
    <p>Cannot shrink log file 2 ('LogFile') because the logical log file
    located at the end of the file is in use.</p>
  </blockquote>
  
  <p>I tested these solutions, but my problem isn't solved yet</p>
  
  <ul>
  <li>DBCC OpenTran =>  No active open transactions.</li>
  <li>Change Recovery Model and DBCC ShrinkFile</li>
  <li>Log Backup AND DBCC ShrinkFile</li>
  </ul>
  
  <p>How can I solve this problem?</p>
  
  <p><strong>SOLVED</strong>
  <br/><br/>I executed this query </p>
  
  <pre><code>SELECT name, database_id, log_reuse_wait, log_reuse_wait_desc FROM sys.databases
  </code></pre>
  
  <p>Result:<br/>
  log_reuse_wait_desc: CHECKPOINT</p>
  
  <p>and after execute <a href="https://msdn.microsoft.com/en-us/library/ms188748.aspx" rel="nofollow noreferrer">CHECKPOINT</a> and DBCCSHRINKFILE my problem solved.</p>