File Format in sp_Send_DBMail Attachment

  • Hi ALL,

    I was trying to find a file format specification for the attachment in sp_send_Dbmail. I wanted to send the attachment as XLS.

    Can we do this?

    Thanks,

    Suri

  • I am not aware of any way to make it send an XLS file. You can however tell it to use TAB as a delimiter and make the extension .CSV and then it will open in Excel when the user double clicks on the attachment. (However if you include column headers the second row still has all the dashes.)

    I sure wish MS would make this more useful.

  • Yeah,UMG Developer s right ...

    You can't just pass "xls" as the extension and have it put it into proper Excel format. No matter what extension you use, it'll have the same format. The format is just text.

    To get better formatting, bcp the data out to a csv file and then attach the csv file to the email. Excel understands csv format very well.

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

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