BCP out to include field columns names - by ivanrdgz

Status : 


Sign in
to vote
ID 288800 Comments
Status Active Workarounds
Type Suggestion Repros 2
Opened 7/24/2007 5:46:45 AM
Access Restriction Public


BCP out to include field columns.
Would be very helpful it the BCP command line tool will have the option to export the field column names
Sign in to post a comment.
Posted by saulcruz on 10/5/2017 at 1:38 PM
Any updates on this feature? this can make a huge difference when exporting huge sql tables!!
Posted by olafg on 5/28/2014 at 3:54 AM

This problem is still open.
Many People use diverent workaround.

I allthoug missing for BCP a text seperatr for Quots like.

thx Olaf
Posted by James Satterthwaite on 2/22/2012 at 7:56 AM
One simple workaround to allow automation - (A 3 step job):
1. Create a file <table_name>_header.txt that has the column headings
    i.e. copy the first row [with header] of a select * from table, paste into excell, keep only headings and save as .txt

2. bcp out to <table_name>_Data.txt file
    i.e. bcp DB.dbo.table_name out c:\table_name_Data.txt -Sserver -T -c

3. Concatenate files with the copy command
    i.e. copy /a /Y C:\tbl_header.txt + C:\tbl_Data.txt C:\tbl.txt

Also, you can bcp out of a view which offers tremendous additional functionality... :-)
Posted by AaronBertrand on 1/23/2012 at 11:23 AM
It's been three and a half years, and we're headed toward our third release since this item was filed, but is this still being considered for "our next release"?
Posted by Microsoft on 10/4/2007 at 10:13 AM
Thank you for your feature suggestion. We are considering the improvement in our next release.