2

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?

Hadi
  • 36,233
  • 13
  • 65
  • 124
Rick
  • 1,392
  • 1
  • 21
  • 52

1 Answers1

1

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:

Hadi
  • 36,233
  • 13
  • 65
  • 124