title: SQL Server MDF Files - How to back up
body: <p>Here's the scenario:</p>
  
  <p>We have a corporate website with three databases.  It's running SQL Server 2005.  The three databases are linked to MDF files.  Someone tried to directly copy / paste one of these MDF files that did some kind of lock on the file that caused a read-only error.  We fixed this by detaching / reattaching.</p>
  
  <p>To prevent this again, we're looking to get copies of these databases to demote to our QA database.  </p>
  
  <p>What's the best way we can make copies without taking the corporate site down? I tried to search google and didn't come up with a decent way.  The databases are fairly small, and the worst case I can think of is just to shut down the SQL Server Service, then just copy the MDF's, then restart the service.  I'm assuming that's 10 seconds at the most downtime. </p>
  
  <p><strong>[Please note anyone reading this, do not directly copy MDF files, make sure you at least take the DB offline or the DB can be locked]</strong></p>