File attachment or query results size exceeds allowable value of 1000000 bytes, exceedsallowable
DECLARE @ tab char (1) = CHAR (9) EXEC msdb. dbo. sp_send_dbmail @ profile_name = 'backgroundy', @ recipients = 'xxx @ wuxiapptec.com ', @ query = 'select cardno, badge, empname, empdep, swptime, macip from CanteenProject. dbo. ADSSwipData where badge like't % ''and (swptime> CONVERT (varchar (7), DATEADD (mm,-1, GETDATE (), 23) + ''-21'' and swptime <CONVERT (varchar (7), GETDATE (), 23) + ''-21 '')', @ subject = 'monthly Trainees Checkin log', @ attach_query_result_as_file = 1, alipay', @ query_result_separator = @ tab, @ query_result_no_padding = 1
Run the preceding statement separately and report the following error:
File attachment or query results size exceeds allowable value of 1000000 bytes.
Solution:
Configure 'database mail' to increase the 'maximum file size (in bytes.