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 = 'backupNotify',
@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,
@query_attachment_filename='TraineesCheckin-ConfidentialData.csv',
@query_result_separator=@tab,
@query_result_no_padding=1
单独执行上面的语句,报错:
File attachment or query results size exceeds allowable value of 1000000 bytes.
解决办法:
配置‘数据库邮件’,将‘最大文件大小(字节)’设置得大些。
本站文章为和通数据库网友分享或者投稿,欢迎任何形式的转载,但请务必注明出处.
同时文章内容如有侵犯了您的权益,请联系QQ:970679559,我们会在尽快处理。