title: How to rename the Physical Database Files
body: <p>I have used tsql to detach a database like this:</p>
  
  <pre><code>EXEC sp_detach_db @dbname = 'my_db'
  </code></pre>
  
  <p>I then made use of PHP to rename the physical files. I was able to rename the mdf file but not the ldf file! I even tried a dos command <code>REN</code> but that didn't work for the ldf file either!</p>
  
  <p>I wanted to ask, is there something special about the physical log files that allow it not to be renamed?</p>
  
  <p>Is there a better way of doing this?</p>
  
  <p>Thanks all</p>