SQL Mail attachments and Unicode

  • SQL mail will send query results inmessages as attachments - but the attachment is a unicode text file, which most text editors don't use by default. So my users are going to have a hard time making sense of any file attachment I send them ( I want to make it a file attachment rather than in the mail body as the info is semi-confidential).

    Can you make the attachemnt ANSI/Windows text?

  • This was removed by the editor as SPAM

  • The problem that you're likely to run into is the client computer will determine what application is associated with a given file extension. For instance, .txt is associated with Notepad by default and .gif or .jpg is associated with Internet Explorer. Unfortunately, there is little you can do if the file association they have set up uses a text editor that doesn't support Unicode.

    What about if you named the attachment .doc so it would be opened by Microsoft Word by default? If they've set Word to auto-select conversion, it should detect the Unicode and respond accordingly. Otherwise, they'll have to select. Alternately, you could use a file extension that shouldn't be associated and your users would have to know to save it to disk and open it with an appropriate program.

    K. Brian Kelley

    http://www.truthsolutions.com/

    Author: Start to Finish Guide to SQL Server Performance Monitoring

    http://www.netimpress.com/shop/product.asp?ProductID=NI-SQL1

    K. Brian Kelley
    @kbriankelley

  • Thank you . That's a perfect solution.

    I've only now become aware that the @attachments parameter in xp_sendmail allows you not only to specify an existing file to attach, but the filename that will contain the query results, so long as @attach_results = true. So if I specify a *.doc file, users have the option of handling the unicode instead of a Notepad full of gobbledegook.

  • I believe that Word does handle Unicode, but I honestly have no way of testing. However, yes, if it does, specifying .doc would eliminate the issue for those who have Microsoft Word installed (at this point, who doesn't).

    K. Brian Kelley

    http://www.truthsolutions.com/

    Author: Start to Finish Guide to SQL Server Performance Monitoring

    http://www.netimpress.com/shop/product.asp?ProductID=NI-SQL1

    K. Brian Kelley
    @kbriankelley

Viewing 5 posts - 1 through 4 (of 4 total)

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