SSIS Getting Execute Sql Task result set object

前端 未结 1 1442
小鲜肉
小鲜肉 2021-01-06 05:10

I have an execute sql task item and it is getting multiple rows of data from a stored proc.

Declared a variable ObjShipment under the variable table and

相关标签:
1条回答
  • 2021-01-06 05:51

    So generally speaking you use Object variables within an SSIS package as the Enumerator of a For Each container.

    1. Create a For Each Loop Container.
    2. Set the Enumerator to a "For Each ADO Enumerator".
    3. Set the source variable to User::ObjShipment.
    4. Assign each column from your object to its own variable in the Variable Mappings tab.
    5. Within the For Each Loop container, use those variables to do whatever you want: insert them into a database, do lookups and audits, etc.

    If you are going to use a Script Task, then you all need to do is

    DataTable dt = new DataTable();
    OleDbDataAdapter oleDa = new OleDbDataAdapter();
    oleDa.Fill(dt, Dts.Variables["User::objShipment"].Value);
    

    And then use dt like any old DataTable.

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