sp_send_dbmail - possible to get non-Unicode output?

  • I'm sending data by email to an external partner using sp_send_dbmail and attaching the output of a query. The recipient tells me they can't load the data at their end as their system doesn't handle Unicode. According to BOL, sp_send_dbmail only sends in Unicode. I've worked around this by creating an SSIS package to export the query to a text file and then email the text file, but am wondering if there's a way to get the data emailed from sp_send_dbmail in ASCII format. I'm the only one at our company that uses SSIS, so I'd prefer a T-SQL only approach as it would help my colleagues to maintain the process if I'm not here.

    --
    Scott

  • Someone else did the following.

    The only workaround that I could come up with was to use BCP with my query to generate the ANSI text file in a temp folder on the server. Then I sent the resulting file as an attachment with sp_send_dbmail as normal. You can use timestamps to ensure a unique filename and then just delete the file when done with xp_cmdshell. Not pretty but it works.

  • Same sort of workround as me then, but thanks for the response. I think my colleagues would find bcp more intimidating than SSIS - I have shown everyone how a package works and how to edit it in BIDS.

    --
    Scott

Viewing 3 posts - 1 through 2 (of 2 total)

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