title: sp_send_dbmail sends empty results
body: <p>When using <code>sp_send_dbmail</code> like this :</p>
  
  <pre><code>EXEC msdb.dbo.sp_send_dbmail
      @profile_name = 'MY_PROFILE'
      ,@recipients = 'MY_EMAIL_ADDRESS'
      ,@query = 'SELECT TOP 50 FIELD1, FIELD2, FIELD3 FROM TABLE1'
      ,@subject = 'MY_SUBJECT'
      ,@body = 'This is a test'
      ,@attach_query_result_as_file = 1
      ,@query_attachment_filename = 'file.csv'
      ,@query_result_separator = '    '
      ;
  </code></pre>
  
  <p>The attached files is always empty. I tried my query outside of <code>sp_send_dbmail</code> and it works perfectly. I also tried to replace my query by <code>SELECT 1</code> and then my attached file has data.</p>
  
  <p>What could cause my query to return no data?</p>