locked
Send CSV file with db_sendmail - missing records RRS feed

  • Question

  • I am trying to send a csv file with 15000 records via the database mail in SQL Server 2014. The problem is that when I open my email the csv only contains 209 records. I have tried the same thing in SQL Server 2012 and it works as expected - it sends the 15000 records in the csv.

    I have tested this on several sql servers with 2014 edition on them, and I have the same issue on all of them. The query breaks off at different points on each sever - for example one of them breaks off at 209 records as i said above, another one at 307. The last record always gets truncated at the same place. The csv attachment size it's about 64 kb - which is well below the 4MB limit i've configured the database Maximum File Size bytes parameter.

    What i am doing basically is creating a job that is meant to execute a stored procedure and send the results in a csv in an email. The stored procedure is something like:

        select col1, col2, col3 
        from table A1
        where col1 > 1000 order by col1

    Does anyone have an idea if something changed in the 2014 edition? Or can give me some tips on what to look at next?

    Tuesday, May 19, 2015 7:32 AM

Answers

  • https://connect.microsoft.com/SQLServer/feedback/details/850260/sql-2014-sp-send-dbmail-64kb-query-result-limit
    • Marked as answer by olia2407 Tuesday, May 19, 2015 8:50 AM
    Tuesday, May 19, 2015 8:41 AM

All replies

  • Might be worth checking the steps mentioned in the below solution

    http://stackoverflow.com/questions/11537657/why-all-the-records-are-not-being-copied-from-csv-to-sql-table-in-a-ssis-package

    Tuesday, May 19, 2015 8:24 AM
  • Thanks - but this is not my case. Appreciate it though.
    Tuesday, May 19, 2015 8:28 AM
  • https://connect.microsoft.com/SQLServer/feedback/details/850260/sql-2014-sp-send-dbmail-64kb-query-result-limit
    • Marked as answer by olia2407 Tuesday, May 19, 2015 8:50 AM
    Tuesday, May 19, 2015 8:41 AM
  • This is it - many thanks!
    Tuesday, May 19, 2015 8:50 AM