Saving to a csv file

  • Is there a way in query analyzer to save the results of a query to a csv file automaticall and have it overwrite any existing file thT is already there?

  • Semi-automatically.  Select Tools/Options/Results and set 'Results to File' as the 'Default Results Target' and set the Results output format to CSV.

    But you'll have to supply the filename and path.

    If you need to run the same query/extract repeatedly and automatically at scheduled times, DTS is probably the way to go.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • How do I set that up in DTS?

     

    Thanks for the reply

  • A little difficult to discuss in a forum

    Check out this Tut

    http://www.sqldts.com/default.aspx?278

  • Thanks anyway

  • You can just use the import/export wizard.

    Just right click on the database and select all tasks, export data.

    Select a text file as destination.

    The rest is simple.

    Joachim.

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

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