Issue : One email report is working fine from long time but suddenly it failed today with below error.
Msg 22051, Level 16, State 1, Line 0
File attachment or query results size exceeds allowable value of 1000000 bytes.
Solution : Email report is failing at send mail because file attachment size is more than set limit of 1MB. We need to reconfigure DB Mail to change file attachment size limit.
Query Used to send email report :
@recipients = ‘email@example.com’,
@subject = ‘DB Report’,
@file_attachments = ’F:\Script\DBReport.csv’,
@body = @Final_Html,
· Go to DB Mail Configuration
· Select “View or Change system parameters”
· You can find Maximum file size is set to 1MB
· I have changed it to 5MB & reconfigure it.
· DB Mail reconfigured for 5MB attachment file size
Reference: Rohit Garg (http://mssqlfun.com/)
You can find and follow MSSQLFUN:-
Other Linked Profiles :-