Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 BCP-First row has column Names
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

181 Posts

Posted - 04/20/2004 :  17:13:50  Show Profile  Reply with Quote
I want to export data in around 40 tables using bcp. The database is on sql server 2000. When i bcp each table i want the first to have column Names. Is this doable using bcp? Or should I using the datapump task 40 times to export the data to a text file. One of the key requirement is that the first row in the text file should have column names.

Thank you

Ramdas Narayanan
SQL Server DBA

Almighty SQL Goddess

38200 Posts

Posted - 04/20/2004 :  17:31:57  Show Profile  Visit tkizer's Homepage  Reply with Quote
bcp does not have the option of putting the first row with column names. You could possibly put them in yourself using the INFORMATION_SCHEMA view called COLUMNS and a UNION to your table. I would go down the DTS route.

Go to Top of Page

Jedi Yak

2489 Posts

Posted - 04/20/2004 :  18:16:48  Show Profile  Visit MichaelP's Homepage  Reply with Quote
If you put the field names as the first row in your select statement, that should do it as well (using BCP).


<Yoda>Use the Search page you must. Find the answer you will.</Yoda>
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.07 seconds. Powered By: Snitz Forums 2000