SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

DB Mail error “File attachment or query results size exceeds allowable value of 1000000 bytes”

Issue : One email report is working fine from long time but suddenly it failed today with below error.

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 :

EXEC msdb..sp_send_dbmail

@recipients = ‘rohit.garg@mssqlfun.com’,

@subject = ‘DB Report’,

@file_attachments = ’F:\Script\DBReport.csv’,

@body = @Final_Html,

@body_format =’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 :-






I, Rohit Garg, am working as Consultant in IT Company. I am having an around 5 years of experience in MSSQL server & other Microsoft technologies. I am working as DBA in Microsoft SQL Server from last 5 years in e-Commerce, Telecom, Finance domain. In this tenure, I got a chance of working as Database administrator, Developer and trainer on SQL server 2000 to SQL Server 2012. I am holding Master’s degree in Computer Science along with certification in SQL Server & .Net. I like to learn new things by hand-on experience on regular basis. This journey is so far is delightful & valuable with the addition of wonderful friends.


Leave a comment on the original post [mssqlfun.com, opens in a new window]

Loading comments...