Equivalent MS SQL to the INTO OUTFILE MySQL command

  • In MS SQL 2008 is there an equivalent to the MySQL command :

    SELECT * FROM test_tbl

    INTO OUTFILE 'c:/out.csv'

  • if you are using SSMS, you can just choose "Results to" --> Results to File. you right click on the TSQL window to see that.

    or, you use sqlcmd

    sqlcmd -Q "SELECT * FROM test_tbl" -o MyOutput.txt

  • HI,

    without any manual interaction, i want to save a query output a text/csv file in my SQL database

    Example:

    SELECT * FROM ORDERS -- which is returning 25 rows

    i want save these 25 records as a text/csv file as a stream in another table at back end only.

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

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