0

I am sending csv file from SQL Server using below query.

EXEC @RtnCode = sp_send_dbmail
  @profile_name = 'Mail',
  @query_result_separator=@Separateur,
  @recipients = 'xxx@xxx.com;', 
  @subject = @mailSubject,
  @query = @STMT,      
  @Attach_Query_result_as_file = 1,
  @query_attachment_filename = 'filename.csv',
  @query_result_header = 1,
  @query_result_width = 32767,
  @query_result_no_padding = 1

Mail size in 'Database Mail' was configured as 1 MB. I have changed it to 5 MB. And restarted SQL Server agent. But Mails are not getting triggered, even though it is getting queued in Mail Queue.

Please help, Thanks in advance.

Erma
  • 337
  • 1
  • 6
  • 14
  • 2
    whether the sp_send_dbmail works fine without attachments? – Ramji Aug 10 '18 at 12:28
  • @Ramji sp_send_dbmail works fine for even 1000 rows in the attachment. More than that, it is not getting triggered. – Erma Aug 13 '18 at 05:05

0 Answers0