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

來源:互聯網
上載者:User

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.

解決辦法:

配置‘資料庫郵件’,將‘最大檔案大小(位元組)’設定得大些。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.