user8189
user8189

Reputation: 79

SQL Server Integration Services

I am using SSIS to import an Excel file into a table in my SQL Server 2008 database.

Currently I am able to import data into the table by using data flow setting Excel file as the source and data table as the destination. My current import is based on the column mapping between source and the destination, but now I want to add an extra column to the table (basically this column will have the id that is given to the Excel file of which the rows are part of, so this value will be same for each row that belongs to the file whose data we are currently importing)

This column is not present in the source Excel sheet and its value is in a SSIS user variable. I want the insertion of this value a part of the import process, but I cannot figure it out?

How can I achieve this?

The connection manager for the destination doesn't allow me to map user variables to columns...

Upvotes: 0

Views: 215

Answers (2)

sunil
sunil

Reputation: 54

Add a execute SQL task after the dataflow task and update the extra column with the variable with an update statement.

Upvotes: 0

cairnz
cairnz

Reputation: 3957

Put in a Derived column between the Excel Source and the Database destination. enter image description here

Create a column there and use the SSIS User Variable as the value expression for the column.

enter image description here

Upvotes: 7

Related Questions