title: sp_send_dbmail with Binary Attachment Issue
body: <p>I am attempting to use sp_send_dbmail to send out an attachment.
  The attachment is stored in a varbinary(MAX) column in a table. Here is my query:</p>
  
  <pre><code>EXEC msdb.dbo.sp_send_dbmail 
          @recipients='mick.walker@somewhere.com',
          @subject = 'Test Attachment',
          @body = 'Test',
          @body_format = 'HTML',
          @profile_name = 'intranetadmin',
          @query = 'Select DocumentData from [myDB].[dbo].[Documents] Where DocumentID = 8',
          @query_result_header = 0,
          @attach_query_result_as_file = 1,
          @query_attachment_filename = 'Test.pdf',
          @exclude_query_output = 1,
          @query_no_truncate = 0;
  </code></pre>
  
  <p>The email sends sucessfully with a pdf attachment. However when it comes to opening the attachment, I get an error. I think the size of the file is being truncated, even though I explicitaally state no to in my query.</p>
  
  <p>I have checked the MAX allowed message size in the Database Mail settings and it is currently 104857600 bytes (100mb), the files I am attempting to send, are nowhere near this size - so I am a little puzzled.</p>