title: Converting from base64 string to varbinary(max) in SQL Server
body: <p>I have PDF documents stored in my table as binary, the column that stores the bytes for the PDFs is type <code>varbinary(max)</code>. I want to <code>update</code> one record with an updated document in SQL Studio, the way I am attempting to accomplish this is like below</p>
  
  <pre><code>UPDATE table
  SET file_bytes=CONVERT(varbinary(max),'JVBERi0xLjYNCiW2JqDQo8PC9UeX...0YNCg==') --this is a base64 string
  WHERE id='73c75254-ad86-466e-a881-969e2c6e7a04';
  </code></pre>
  
  <p>The query runs, but when I try to download the document (via the website), it throws an error message that reads <code>PDF header signature not found.</code></p>
  
  <p>Is this conversion even possible?</p>