E-Mail CSV File

  • In SQL2000 I have package which in the end uses XP send mail to email the results of select queries as a CSV file.

    Upgrading to 2005, I have updated the package as necessary to use database mail, but the CSV file that gets emailed puts the query results all in one column with the commas rather than actually delimiting into separate columns, I do have @query_result_separator = ','

    Any ideas what the issue might be?

  • Ok - I finally found a solution to this, to get Excel to open up the CSV in separate columns, I changed the separator to a tab.

    @query_result_separator = 'tab', ---- tab separated where tab is the tab key, not the word Tab

  • Hi,

    You can use the sp_makewebtask sp, with this s.p. you can generate a HTML file or Excel file (just changing then extension of the file to .xls),

    try this:

    sp_makewebtask @outputfile = 'youfile.xls'

    , @query = 'Select * from youtable'

    , @colheaders =1

    , @resultstitle='Title of your report'

    Sebastián Rodríguez R.
    Licenciado en Informática de Gestión
    sebas_rod@hotmail.com
    (569) - 98626471

  • Thanks - will give this a try as well

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

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