Output Query & Stored Procedure results to Text File with Headers (Pipe Seperated )

  • Our users want a Dump of the SQL Data which could come by running Query and Stored Procedure every day to a text File.

    They will use these text files to load the data into Excel to do a reporting.

    The Text file should have the column header also.

    output to \etwork1\TextFiles\Order.txt

    select * from Orders where orderDate <= 11/1/2013

    output to \etwork1\TextFiles\JobTran.txt

    EXEC JobTransSp '11/1/2013'

  • Have you tried using bcp or SSIS?

    John

  • I tried bcp but it does not give a column headers just a data.

  • Is there a way to get the column names of the query and stored procedure to text file.

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

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