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

Source: Internet
Author: User
Tags getdate

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 ()), + ' -21 ' and swptime<convert (varchar (7), GETDATE (),) + ' -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

Execute the above statement separately, the error:

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

Solution:

Configure ' Database Mail ' to set the ' Maximum file size (bytes) ' Larger.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.