Creating csv File

  • Hi,

    I need to create a script that will produce a list of results from a database, and save those results to a csv file.

    Other than the user saving the results pane in Query Analyser, is there another way of automating the export to a text file?

     

    Kinds regards

     

     

  • Depending on your particular needs, I'd probably recommend either a DTS package or bcp. Both can accomplish what you want.

  • Read about bcp command in BOL.

    All answers for you are there.

    _____________
    Code for TallyGenerator

  • BCP is a useful piece of kit for this, however if you are going to be exporting a number of queries instead of just the odd, adhoc ones I'd use DTS and create a package that can be dynamically used for exporting a number of queries and tables.



    Ade

    A Freudian Slip is when you say one thing and mean your mother.
    For detail-enriched answers, ask detail-enriched questions...[/url]

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

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