INFO: Modifying BCP Format File to Load into Specific Columns (52201)
The information in this article applies to:
- Microsoft SQL Server 4.2x
This article was previously published under Q52201 SUMMARY
The BCP format file can be modified to skip over data in the BCP
input data file and be loaded into specific columns of a table. The
fifth column of the BCP format file identifies which column (first,
second, third, etc.) of a table the corresponding field of the input
data file is loaded into. The values of the column identifiers can be
changed to redirect the load of the input data file.
For example, when a 0 (zero) is placed in the fifth column value in
the .FMT file, BCP does not insert that data field (defined by the
number in the first column in the .FMT file) into the table. This
fact can be used to load either a data file with fewer or more data
fields than the number of columns in a table. If more columns are in
the database table than are in the input data file, the columns not
being loaded with data must be defined to accept null values.
Modification Type: | Minor | Last Reviewed: | 2/14/2005 |
---|
Keywords: | kbinfo KB52201 |
---|
|