I have two Foreach Loop,which hava same enumerated values.So how do I deal with it?

守給你的承諾、 提交于 2019-12-24 00:26:28

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!