欢迎投稿

今日深度:

File attachment or query results size exceeds allowable valu

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.

解决办法:

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

www.htsjk.Com true http://www.htsjk.com/shujukunews/8286.html NewsArticle 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...
相关文章
    暂无相关文章
评论暂时关闭