xp_sendmail attachement format

  • I'm having a problem getting the results of a query attached via xp_sendmail to "look" correct for my users.

    exec master..xp_sendmail @recipients = '<name>', @subject = '<subject>',

    @query = 'Select groupcode as filename, lettercode, count(*) as count, filedate from temploadpac

    group by groupcode, lettercode, filedate order by filedate, groupcode, lettercode',

    @dbuse = '<db>', @attachments = 'PacCounts.txt', @attach_results = 'TRUE'

    My users open the attachement in notepad, and they get text that is not formatted neatly into columns. They have to save the attachement and open it in excel to view it correctly. I have tried using various @separators, and none, and various @widths, but nothing seems to work.

    Can anyone help me out? Thank you for your time!!

  • The answer turns out to be...a service pack/hotfix for sql server 2000. This adds a new parameter called @ansi_attachment that can be set to true. This ensures attachments aren't sent out in unicode by default.

  • The answer turns out to be...a service pack/hotfix for sql server 2000. This adds a new parameter called @ansi_attachment that can be set to true. This ensures attachments aren't sent out in unicode by default.

  • The answer turns out to be...a service pack/hotfix for sql server 2000. This adds a new parameter called @ansi_attachment that can be set to true. This ensures attachments aren't sent out in unicode by default.

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

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