SELECT INTO OUTFILE?

Hi,

how do I redirect the output from a SELECT to a text-file, or Excel-file

It is possible in MySQL, but what about Transact-SQL

Thanks



Answer this question

SELECT INTO OUTFILE?

  • Suprotim Agarwal

    Thanks!

    Sten-Gunnar


  • Aaron Oneal

    Thanks!

    Sten-Gunnar


  • malangpc

    YOu have to use the OPENDATASOURCE method or a linked server to insert data in another destination than the local SQL Server. More information (including a sample can be found in the BOL)

    HTH, Jens Suessmeyer.

    ---
    http://www.sqlserver2005.de
    ---


  • mostaf

    If you put your select statement in a file and use osql (SQL 2000) or sqlcmd (SQL 2005) you can direct your output to a text file.

  • SELECT INTO OUTFILE?