ansi attachment file by using sp_send_dbmail

  • Hi there,

    I have a problem on sending csv attachment file by using sp_send_dbmail.

    When open it up, i alwys got a error message on not reconize formatting.

    In the sql server 2000, we used xp_sendmail and using @ansi_attachment=true which working well.

    Is there anyone know how to convert attachment file from unicode to ansi format?

    Kindly help..

     

     

  • Hi,

    I have a similar problem myself when it comes to generating a .csv attachment using;

    @query='<SQL Query>',

    @query_attachment_filename = '<filename>'

    feature of sp_send_dbmail

    Everytime when I go to open up the file attachment in Excel, It throws the same error message, however it's more of an annoyance than a problem, because it still let's me open the file, and the results display as expected.

    -Chuck

     

  • I have already brought this to MS's attention. I was told it was an oversight and will be fixed in SP2.

  • Have you had any feedback further on this? I've run into this, trying to use sp_send_dbmail for the first time. SP2 went CTP on 6 November - I wonder how long before it goes out?

    If anyone has a solution for this, please let me know, otherwise we will have to write an SSIS package for each on of these derned things

  • FIX: Error message when you try to open a file attachment in a message that is generated by the sp_send_dbmail procedure in SQL Server 2005: "This file is not in a recognizable format"

    http://support.microsoft.com/default.aspx?scid=kb;EN-US;924345

     

  • Thanks for the response! Pity the underlying KB isn't in place - I get '

    The Knowledge Base (KB) Article You Requested Is Currently Not Available'

    if I try to click through

  • this has been resolved in SP2, fyi. My alerts no longer have this issue

  • I have installed SP2 and it still creates attachments in UNICODE format.

    Is there a new sp_send_dbmail option in SP2 we need to use in order to have it create ANSI attachments?

  • Unfortunately, afaik, no, there is no 'ANSI attachment' option. Wish there was. My issue was fixed simply from the point of view that SP2 corrected the errors in the format of the csv file, which allowed excel to open the file without complaining.

  • Wanderer is correct. There is no new parameter with sp_send_dbmail, its in-built now.

    921896 A list of the bugs that are fixed in SQL Server 2005 Service Pack 2

    http://support.microsoft.com/default.aspx?scid=kb;EN-US;921896

    Above refered to KB 924345, which is not getting opened. (should be fixed soon)

    It mentions that issue is fixed in SP2.

  • Graben la salida del select como un archivo a disco, alli se grabara como ANSI, luego hacen que el proceso tome este archivo y lo envie como un attach.

  • :unsure: ??

  • Hi guys!

    Maybe i missed somethig...

    Is there any way to generate the txt file in ANSI encoding or not?

    Thanks

    Andrew

  • After you apply the SP2, the sp_send_dbmail procedure only generates files in a recognizable Unicode format, not an ANSI format.

Viewing 14 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic. Login to reply