title: How to put .pdf file contents into varbinary(max) column
body: <p>I'm trying to put the contents of a <code>.pdf</code> file into a column of type <code>varbinary(max)</code>.</p>
  
  <p>How I can achieve this? I played with <code>convert</code> and <code>cast</code>, but it doesn't seem to work.</p>
  
  <p>I was thinking about defining <code>var1 varbinary(max)</code> and setting it to the file's contents, but this also failed.</p>
  
  <pre><code>declare @var1 varbinary(max)
  set @var1 'c:\xxx\inp.pdf' ???
  </code></pre>
  
  <p>and then:</p>
  
  <pre><code>insert into t1(xdata) values ( @var1);
  </code></pre>
  
  <p>Or maybe I can use insert from file, not sure is this possible without BULK?</p>
  
  <p>Appreciate your help, I can't use contents of <code>.pdf</code> file in single qoutes either, it treats it as <code>varchar</code> -(</p>
  
  <p>Thanks all for help.
  Dai</p>