Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
kmslick
Starting Member
6 Posts |
Posted - 2009-01-15 : 17:06:56
|
| Can anyone tell me how to include the field headers in an output file?I'm using:bcp DB.dbo.AuditExportGL20000 out c:\bcp\test.txt -c -t"|" -T -S ' + @@servernameThis works fine but I need the first row of the output file to be the table column names. |
|
|
revdnrdy
Posting Yak Master
220 Posts |
Posted - 2009-01-15 : 17:25:43
|
| Well here is a link that I used to do that. What you will need to do is BCP out of a view. [url]http://www.sql-server-performance.com/tips/bcp_p1.aspx[/url]Here is a another example (but a little more complicated). It is from Tara's blog.[url]http://weblogs.sqlteam.com/mladenp/archive/2006/07/25/10771.aspx[/url]Hope that helps you on your sql journey...r&r |
 |
|
|
kmslick
Starting Member
6 Posts |
Posted - 2009-01-15 : 18:33:26
|
| Thanks! |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|