Monday, April 6, 2015

Avoiding text-qualifier in the header rows while loading data to a flat file destination

Normally we get a requirement to process data from database and load the data to flat file destination.
Sometimes, we may have to add a text-qualifier as the value itself may have a separator in it.
Example: if its a csv file, we may have a value as SurfMyAds.com, Inc.

In such cases, we may have to enclose such values inside a text-qualifier like "SurfMyAds.com, Inc."

Now, when we specify text-qualifier in flat-file connection properties, even the column header also gets text-quailifer. May be something as shown below

"Name","Salary","DOJ","Department"
"Sachin","8000","2014-01-01", "Finance"
"Rahul","5000","2015-01-01","HR"




Now

But, we do not need text-qualifier in header rows.
To satisfy this requirement, we have to disable the option of "column names in the first row" in the flat file connection manager, as shown below


Later, in the data flow task, open the flat file destination. In the connection manager properties, under the section "Header" specify the column heading that is required. Sample has been shown below:
Once these settings are done, header rows in flat file destination will not have text-qualifiers




 

1 comment:

  1. except now you are mapping with generic column names rather than the actual header column names.

    ReplyDelete