SQL Server Forums
Profile | Register | 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
 New Topic  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

38073 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  
 New 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.06 seconds. Powered By: Snitz Forums 2000