Reputation: 1272
In SSIS, i want to read data from a flat file(Flat File Source) and assign certain column values to a variable in SSIS (like IDNo). I need this ID to retrive other information like email and other details to send email dynamically later in the process. I did some reasearch i found that Script Component is one of the way to assign values to variables, but in our environment script component is not available. Is it possible to do that if so, can some one please provide me a sample. thanks.
Upvotes: 2
Views: 16089
Reputation: 13141
You don't necessarily need script component to achieve this.
Read your IDs to a recordset (that would be a variable of type Object
):
Data Flow Task
create a Recordset Destination
.VariableName
dropdown.Create Foreach Loop Containter
:
Foreach ADO Enumerator
in Enumerator
setting.ADO object source variable
pick your recordset variable from the dropdown listVariable Mappings
assign your email variable with index 0Send the emails from the loop using email variable as an expression in Send Email Task
.
Why is script component not available? It'd make things easier and help to avoid some problems; I don't use mail task anymore in favour of script task, because I ran to some problems with it in the past.
Hope this helps.
Upvotes: 6