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 ignore CSV field using BCP

Author  Topic 

SamC
White Water Yakist

3467 Posts

Posted - 2005-10-18 : 09:37:16
I've got a CSV file with a couple of fields I need to ignore.

BCP's bcp.fmt syntax seems to direct every field to a column in a target table.

How do I skip over an input field in the CSV file?

Sam

Example...

8.0
10
1 SQLCHAR 0 100 "\t" 1 Email SQL_Latin1_General_CP1_CI_AS
2 SQLCHAR 0 50 "\t" 2 UserName SQL_Latin1_General_CP1_CI_AS
3 SQLCHAR 0 50 "\t" 4 FirstName SQL_Latin1_General_CP1_CI_AS
4 SQLCHAR 0 50 "\t" 6 LastName SQL_Latin1_General_CP1_CI_AS
5 SQLCHAR 0 100 "\t" 7 SkipThisColumn SQL_Latin1_General_CP1_CI_AS
6 SQLCHAR 0 100 "\t" 8 Branchname SQL_Latin1_General_CP1_CI_AS
7 SQLCHAR 0 50 "\t" 20 Assigned SQL_Latin1_General_CP1_CI_AS

SamC
White Water Yakist

3467 Posts

Posted - 2005-10-18 : 09:56:26
Found it.

http://msdn2.microsoft.com/en-us/library/ms179250
Go to Top of Page
   

- Advertisement -