title: SQL Server 2008 R2 storing multimedia
body: <p>When I store mp3 files, or images (JPEG mainly) into a table the data seems to get altered.  When I load the contents of the table back onto my local machine and do a diff between the original data it is apparent that the files are not the same.  Also the files are not viewable/playable on my local machine.</p>
  
  <p>Any ideas what could be causing this? Is it issues with the varchar data type?</p>
  
  <p>I'm retrieving the data via the "save results as" option, and selecting all files, and applying the correct extension.</p>
  
  <p>Also it's for a school project and the restrictions are not flexible (has to be completely implemented in SQL)</p>
  
  <p>One more thing, what about storing a pointer to the multimedia?  How would I go about doing that?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>USE master
  ----created in master schema
  
  drop table blobtable
  
  CREATE TABLE blobtable
    (BLOBData varchar(MAX))
  
  BULK INSERT blobtable
  FROM 'C:\Murach\SQL Server 2008\test.mp3'
  
  select * from blobtable 
  </code></pre>