locked
Index In variable mapping. RRS feed

  • Question

  • Hi All, 

    Could you please advise me, Why the index value is used in variable mapping while using for each loop container. In one of ssis package I saw the index value as 2. Could you please let me know what 2 indicates in index?

    Thank you !

    Monday, October 5, 2015 11:08 AM

Answers

  • Hi Sreepi,

    See Jamie's Blog

    http://consultingblogs.emc.com/jamiethomson/archive/2005/07/04/ssis-nugget_3a00_-execute-sql-task-into-an-object-variable-_2d00_-shred-it-with-a-foreach-loop.aspx

    inside Foreachloop in Variable Mapping Tab use variable names and  indexing from 0,1,2.... in the order of sql result set

     

    for error check  whether you are getting any row in result set

     

    and you can assign only values of column retrieve from resultset to variables


    Please Dont forget to mark as answer and Helpful Post. It helps others to find relevant posts to the same question. Milan Das

    • Marked as answer by Sreepi Monday, October 5, 2015 11:43 AM
    Monday, October 5, 2015 11:40 AM
  • The for each loop will be based on an enumerator.

    The enumerator will iterate based on its type and for each iteration it will have a return a row with required data based on enumerator type (file name(s) in case of file enumerator, rows in case of recordset,metadata in case of schema rowset  etc). This will have indexes starting from 0 to indicate their ordinal (position). So 2 means its the third column (value) in the resultset that you want to store into the variable for each iteration of the loop.


    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

    • Marked as answer by Sreepi Monday, October 5, 2015 12:35 PM
    Monday, October 5, 2015 12:22 PM

All replies

  • Hi Sreepi,

    See Jamie's Blog

    http://consultingblogs.emc.com/jamiethomson/archive/2005/07/04/ssis-nugget_3a00_-execute-sql-task-into-an-object-variable-_2d00_-shred-it-with-a-foreach-loop.aspx

    inside Foreachloop in Variable Mapping Tab use variable names and  indexing from 0,1,2.... in the order of sql result set

     

    for error check  whether you are getting any row in result set

     

    and you can assign only values of column retrieve from resultset to variables


    Please Dont forget to mark as answer and Helpful Post. It helps others to find relevant posts to the same question. Milan Das

    • Marked as answer by Sreepi Monday, October 5, 2015 11:43 AM
    Monday, October 5, 2015 11:40 AM
  • The for each loop will be based on an enumerator.

    The enumerator will iterate based on its type and for each iteration it will have a return a row with required data based on enumerator type (file name(s) in case of file enumerator, rows in case of recordset,metadata in case of schema rowset  etc). This will have indexes starting from 0 to indicate their ordinal (position). So 2 means its the third column (value) in the resultset that you want to store into the variable for each iteration of the loop.


    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

    • Marked as answer by Sreepi Monday, October 5, 2015 12:35 PM
    Monday, October 5, 2015 12:22 PM