0

I am creating a SSIS package in which i have to move data from Excel to a table in SQL server. Excel file is like Source Assistant in data flow task.

Number columns in Excel file won't change but column names will change. So i have to find all the columns names in Excel file before inserting data.

Could you please help me on this?

Hadi
  • 36,233
  • 13
  • 65
  • 124
Avinash
  • 2,053
  • 2
  • 14
  • 32

1 Answers1

0

Solution overview

  1. Exclude column names in first row in excel connection, use sql command as data access mode
  2. Alias column names in output column as matching your destination
  3. Add a script task before the data flow task that import the data
  4. You have to use the script task to open the excel file and get the Worksheet name and the header row
  5. Build the Query and store it in a variable in the second Data Flow task you have to use the query stored above as source (Note that you have to set Delay Validation property to true)

Detailed Solution

You can follow my answer at Importing excel files having variable headers it is solving a very similar case.

Hadi
  • 36,233
  • 13
  • 65
  • 124