Database Reference
In-Depth Information
Producing a Header Row
Producing a header row is a very simple operation in SSIS 2014, provided you know
the number of rows to be loaded in advance. You simply load the destination flat file
with the header row in one Data Flow task, and then load the data rows to the same flat
file in a subsequent Data Flow task. As we say in Farmville, Virginia: “dog simple.”
There are some subtle complexities in this design, though.
We'll start with a simple file named
MyFileHeaderExtract.csv
that con-
tains the following data:
ID,Name,Value
11,Andy,12
22,Christy,13
33,Stevie Ray,14
44,Emma Grace,15
55,Riley Cooper,16
Add a new SSIS package named
WriteFileHeader.dtsx
to your SSIS pro-
ject. Add the package parameters shown in
Figure 7-25
.
Figure 7-25
.
WriteFileHeader.dtsx parameters
Add two Data Flow tasks to the control flow. Name the first
dft Write Header
Row
and the second
dft Write Data Rows
. Open the editor for dft Write Header Row
and add a Script component named
scrc Build Header Row
to the Data Flow task.
When prompted, configure the Script component to act as a source. Open the editor
Search WWH ::
Custom Search