BCP: How to Display Column Headers

  • HI,

    I'm using the following bcp command to generate a text file. How do I include the column headers as the first row. THANKS

    bcp "SELECT Basix_IM01.dbo.dc_flat_file.* FROM Basix_IM01.dbo.dc_flat_file WHERE ([DC Number] = 6)" queryout "NIN_06_081403.txt" -F 1 -c -t "|"

  • It's not really possible, unless you right a query that looks at syscolumns, and uses a UNION to pre-pend it to the beginning of the result set.

    -Dan


    -Dan

  • BTW...you can use DTS to do that easily.

    -Dan


    -Dan

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

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