November 20, 2002 at 1:29 pm
Does anybody know if there is a way to include the column headings when BCPing from a table?
November 20, 2002 at 2:07 pm
You need o use isql. or do something funky like add the column headers to the resultset i.e
select 'col1', 'col2', 'col3'
union all
select col1, col2, col3
from mytable
Simon Sabin
Co-author of SQL Server 2000 XML Distilled
http://www.amazon.co.uk/exec/obidos/ASIN/1904347088
Simon Sabin
SQL Server MVP
http://sqlblogcasts.com/blogs/simons
November 20, 2002 at 2:16 pm
I don't believe there is any parameter on bcp that will allow you to do that. Like Simon noted, you would have to do it manually.
-Dan
-Dan
November 20, 2002 at 2:18 pm
I semi cheated. I have the SP insert the column names in the top of the table before it exports.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply