code_junkie

sp_send_dbmail & varbinary

Nov 11th, 2011
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. EXEC msdb.dbo.sp_send_dbmail
  2. @profile_name = 'SQL Mail Profile',
  3. @recipients = 'emailaddress',
  4. @query = 'set nocount on; select CAST(content AS varchar(MAX)) from files where fileid=''xxx''' ,
  5. @subject = 'Random File',
  6. @attach_query_result_as_file = 1,
  7. @query_attachment_filename = 'random file.pdf',
  8. @query_result_no_padding = 1,
  9. @query_result_header = 0,
  10. @query_no_truncate = 1;
Add Comment
Please, Sign In to add comment