SQL Server 2008 R2 - remove line below heading (which has ----,----) - dont have SSIS
Unfortunately, there is no way directly from BCP to get the header as well as the rows out in a pretty format, even with the out parameter

HOWEVER, there is a workaround. You can do this:

SELECT 'HeaderCol1Name', 'HeadCol2Name'
UNION ALL
SELECT CAST(C.Col1 AS VARCHAR(255)), CAST(C.Col2 AS VARCHAR(255)) ...
FROM (SELECT &lt;Your original query&gt;) AS C


You can now:

BCP &lt;above query in quotes&gt; out Foo.txt 


Yes, it is ugly. And yes, it works. You can even control things like date formatting this way.