首页 > 其他 > 详细

File attachment or query results size exceeds allowable value of 1000000 bytes

时间:2015-05-21 12:46:57      阅读:172      评论:0      收藏:0      [点我收藏+]

技术分享

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.

解决办法:

配置‘数据库邮件’,将‘最大文件大小(字节)’设置得大些。

File attachment or query results size exceeds allowable value of 1000000 bytes

原文:http://blog.csdn.net/chinadm123/article/details/45889321

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!