Foreach Loop Container For Data Flow Task

后端 未结 1 1961
春和景丽
春和景丽 2021-02-10 09:23

I want to import nearly 12 million records from oracle DB but beacuse of the SSIS memory buffer problem i need to iterate my Data Flow Task for each year i.e 2005 to 2012 (7 tim

1条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-10 10:05

    I have solved the above problem using Sql Server . So only thing which you need to change is the Select query

    1. First Create a variable to store the date for each year .

       Name: TimeValue  DataType=Int32
      
    2. Use a ForEach Loop and select Foreach Item enumerator in the collection tab

    New Column

    1. Click on the Columns tab and create a new column of datatype int

    2. In the variable mapping map the variable created above .

    Mapping

    1. Inside the dataflow use an oledb destination and in the data access mode select sql command .The query in the where clause should be changed and try to select the columns instead of giving *.

    SQL Query

    1. Click on the parameters tab map the parameter created for the foreach loop

    Mapping Paramters

    In case if the values of date are not known before then you can use execute sql task before foreach loop and select only the dateTime column values from the table and store it in a variable and in the foreach loop use Foreach from variable enumerator in the collection tab and select the variable created in the above execute sql task .

    Hope this helps u.

    0 讨论(0)
提交回复
热议问题