xp_sendmail results are not directly openable in excel

  • I remember a couple of years ago of being able to use the xp_sendmail command to send csv files that would open directly in excel without having to use the "Text to Columns" command on the Data Menu.

    Does anyone know what i need to do to get the data to directly convert with out having to create a dts that sends out spreadsheets?

    Many thanks

    He shoots! He misses?

  • Have you tried a tab delimited output or comma delimited output with the extension of CSV?  I know that I did this at my last company and never had to do the text to columns ....??

     

     



    Good Hunting!

    AJ Ahrens


    webmaster@kritter.net

  • yeah i've set the parameters to:

    @attach_results = 'true',

    @attachments = 'file.csv',

    @separator = ','

    and it doesn't seem to be able to open it properly.

    if I set the separator as a TAB then it opens up in columns with the same error message... without having to use the Data to Columns function.

    He shoots! He misses?

  • Silly me! Just found out from MS that there was a change in SP1 to SQL Server 2000 that changed the format of the csv file from UNICODE to ANSI which allows the report to be open without errors in excel. Apparantely this changed from SQL7 to SQL2k (with SQL7 having it work correctly before - i knew it used to work!)

    Anyway if you add a parameter to the command:

    @ansi_attachment = 'true' then it solves the problem.

    I knew i should have looked sooner!

    Microsoft Answer

    He shoots! He misses?

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

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