Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Help with a BCP Format file that handles double-quoted values which may be blank

$
0
0
Can anyone help with creating a BCP format file for the following file structure. 
The first row contains headers enclosed in double quotes
All text values are enclosed in double quotes, but missing values are not.
Example of the file:


"ID","Name","Colour","LogDate"
41, "Orange", "Orange",2018-09-09 16:41:02.000
42, "Cherry, Banana","Red,Yellow",
43, "Apple",,2017-09-09 16:41:02.000

What I have is this: but it doesn't handle missing values without doublequotes:

11.0
4
1       SQLCHAR             0       255       "\",\""     1     ID                SQL_Latin1_General_CP1_CI_AS
2       SQLCHAR             0       255       "\",\""     2     Name                 SQL_Latin1_General_CP1_CI_AS
3       SQLCHAR             0       255       "\",\""     3     Colour                  SQL_Latin1_General_CP1_CI_AS
4       SQLCHAR             0       255       "\r\n"     4     LogDate                      SQL_Latin1_General_CP1_CI_AS

Any ideas please?


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>