Rick
Rick

Reputation: 1559

SSIS - Destination excel does not show up all the cells but only F1, F2 etc

I am trying to export SQL data into template excel using SSIS. My template looks as below:

enter image description here

My SQL code returns data as:

enter image description here

In SSIS in the excel destination not all the columns of my template are showing in the 'Column mapping' section. I can only see 'F1, F2, F3..' in the setting section. Screenshot as below:

enter image description here

Why are the cells A7, B7, C7,..etc are not showing in the column mapping section? any help on how this can be fixed?

Upvotes: 2

Views: 1142

Answers (1)

Hadi
Hadi

Reputation: 37313

In the Excel destination editor, use Change the Access mode to SQL Command and use the following query:

SELECT * FROM [Sheet1$A6:D6]

Where A6 is pointing to the 6th row where columns header are located and D6 is that cells where the last column header is located (D > column index, 6 > 6th row)

This will solve the column header problem, but it will still insert data from the first row, there are many workarounds provided in the following topic:

Upvotes: 1

Related Questions