Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- EXEC msdb.dbo.sp_send_dbmail
- @profile_name = 'SQL Mail Profile',
- @recipients = 'emailaddress',
- @query = 'set nocount on; select CAST(content AS varchar(MAX)) from files where fileid=''xxx''' ,
- @subject = 'Random File',
- @attach_query_result_as_file = 1,
- @query_attachment_filename = 'random file.pdf',
- @query_result_no_padding = 1,
- @query_result_header = 0,
- @query_no_truncate = 1;
Add Comment
Please, Sign In to add comment