码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2015-05-21 12:48:54      阅读:248      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!