Outputing to a text file within a sql script

  • Hello --

    I have created a sql script that generates output when run within the SQL Studio application. I want to able to output to a text file, and I wanted to know if there is a command that be included within the script to so. Can someone provide insight into this?

    Thanks.

  • If you are executing the script manually yourself then right click on result set area, click on 'save result as' and save your file in any format; if you are executing the script through job then giving 'output file' location would do..

  • You can use BCP to output from T-sql to a text file

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

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