reading/writing result set in a file in a SP

  • I an new to SQL server and was wondering if it is possible for me to run queries in a SP and write the result set to a file (lets say ASCII file). Later, can I read data from this ascii file in the SP and then lets say use it to insert values in some tables? Is it possible to do this?

  • You can use BCP and Bulk Insert to extract data to a file or Import data from a file into a table.

    Look up both BCP and Bulk Insert commands in BOL

     


    Regards,

    Aditee Rele

  • Both of those require special privleges, which I normally don't give out.

    Why do you need to work with a text file? Can you not store these values in a table?

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

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