Is it possible to read object variable values in SSIS script component source?
I have a variable, of type Object, which contains records from table populated by using a SQL Script Task.
I have used this Script Task and it's working perfectly by using below code
oleDA.Fill(dt, Dts.Variables("vTableRowsObj").Value)
in this way where vTableRowsObj
is object variable .
I want to read this object in an SSIS script component so that I can directly give the output from script component to the destination table.
The end goal is that I am planning to create more object variables and simply by reading these objects, give the output to destination tables from script component.
Given that you have a table with records populated by a SQL Script task, why is it necessary to load that data into a variable of type Object? Why not just use that table as a data source in a data flow? The basic steps are...
1) Run your SQL Script task and load your results to a table (sounds like you are already doing this)
2) Skip loading the records to the Object variable
3) Instead add a Data Flow Component as a downstream connection to your SQL Script Task
4) Add a Source component to your Data Flow: use the the table you populated with the SQL Script Task as your data source
5) Add a Destination component to your Data Flow: use your destination table as your data destination
However in the spirit of answering the question you asked directly (if I have in fact understood your question correctly), then the simple answer is yes you can use an SSIS script component as a data source in a data flow. This article walks you through the steps.