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.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 How to transfer the header row using BCP utility to the .txt file from the DB table

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-06-10 : 08:15:22
Manu writes "How to transfer the header row using BCP utility to the .txt file from the DB table?
I am generating a .txt file(Tab Separated) and need that the header row of the table(Has 100K Records and Row size 8k Bits) i am copying to the .txt file should also be copied.
Please let me know about this."

kselvia
Aged Yak Warrior

526 Posts

Posted - 2004-06-10 : 11:23:40
BCP will not generate column headings. You can create a view of your data to generate headings:

Create View MyView AS
SELECT 'Column 1 Heading' col1, 'Column 2 Heading' col2, ...
UNION ALL
SELECT col1, col2 ... FROM MyTable

Then use BCP to extract data from MyView insted of MyTable.

Go to Top of Page
   

- Advertisement -