title: How to save binary data back as a file from SQL table
body: <p>I am using Microsoft SQL server database file (file with <code>.mdf</code> extension) as the database.</p>
  
  <p>I managed to save files into the SQL table as <code>varbinary(max)</code>. Now my question is : How do I get back the files?</p>
  
  <p>I am thinking I may still need to use <code>SELECT</code> statement to get the file from the SQL table. However how do I save the file to my hard disk from its current binary format? What are the procedures to do that?</p>