Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

bcp header
Is there any way of including headers when we export a table using bcp
? Can't find the argument in bcp utility books online ?

Thanks for the help


Report this thread to moderator Post Follow-up to this message
Old Post
Patrik
09-20-05 04:23 PM


Re: bcp header
Patrik (patrik.maheux@umontreal.ca)  writes:
> Is there any way of including headers when we export a table using bcp
> ? Can't find the argument in bcp utility books online ?

BCP does not unfortunately not support headers very well. If they can
be molded into the format of the rest of the file, you can sneak by.

Here are some examples:

 value1,value2,value3

12,23,234

This is easy, use the -F option to start on row 2. Here is a tricker one:

 value1,value2,value3

"text",12,"more test"

For this format you need a format file anyway for the data. This format
file will specify that each record begins with an empty column with " as
terminator. The result is that the header slips into that empty column
for the first row. You should not use -F.

Here is a dead end:

 value1,value2,value3

12,"my text",12

I can't find a way to bulk-load this file, because the header does not
match the format of the data rows, and you can hide it an empty column.



--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp


Report this thread to moderator Post Follow-up to this message
Old Post
Erland Sommarskog
09-21-05 01:23 AM


Sponsored Links





Last Thread Next Thread
Post New Thread

Microsoft SQL Server forum archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 12:42 PM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006