March 24, 2006 at 11:09 am
Hello,
MSSQL 7/2000
Using the bcp utility, is there a way to save the column names as row#1? I can't find any docs or examples with this?
Many thanks. Jeff
March 24, 2006 at 11:23 am
No, that is not a function of bcp....
March 25, 2006 at 8:43 pm
Jeff,
If you are talking about importing with BCP, you can tell it to skip the first row by setting the first row (-F) parameter to 2.
If you are talking about exporting with BCP to save the first row with the column names, then Scorpion 66 is correct... can't be done with BCP.
It can, however, be done using OSQL, a SELECT query, and the (-o) output file parameter. And, if you need it in CSV format, just specify the (-s) parameter... here's what that does according to BOL...
-s col_separator
Specifies the column-separator character, which is a blank space by default. To use characters that have special meaning to the operating system (for example, | ; & < > ), enclose the character in double quotation marks (").
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply