问题
I declare two variables as "Object" named a and b, and have a simple SQL task:.
select code from code_list
Using Full result set, I'm trying to pass the result to the variables declared(a and b),
and use them(a and b) on Script Task with two different foreach loops。But it didn't work.
Script Task: insert the result into two different tables(A and B).
回答1:
Create 3 variables of type Object, only use one as ResultSet. Then Add a Script Task, and select 3 variables as Read/Write Variables.
Inside the Script Task, Create two DataTable variables, and Fill one table with the ResultSet variable:
- SSIS - How to access a RecordSet variable inside a Script Task
Then Copy the first DataTable into the second DataTable Variable using dataTable1.Copy()
method
At the end, assign each DataTable to one package Variable.
来源:https://stackoverflow.com/questions/56802442/i-have-two-foreach-loop-which-hava-same-enumerated-values-so-how-do-i-deal-with