Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

how can we capture the itration in for eachloop container in ssis 2008

Posted on 2012-04-02
2
Medium Priority
?
226 Views
Last Modified: 2012-07-05
hi

i am using the for each loop container to picup multiple tab delimted files to excel files

i need capture the each itaration value to one variable, i am going use this variable in some other places


Example: first itration  the variable should capture the 1
second time 2
third time 3..........etx

how can i do this
0
Comment
Question by:parpaa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 37

Accepted Solution

by:
ValentinoV earned 1500 total points
ID: 37799537
Do you mean how to capture the file name of the files in the loop?  Have a look at the Variable Mappings page of the ForEach Loop properties.  Specify a package variable (of type string) with index 0.  While looping, that variable will then contain the name (or path + name, depending on what you selected in the Collection page)

Or do you really need an increasing integer?  In that case, create a package variable of type Int32 and use a Script Task in your loop to increase it by 1.

More info: http://msdn.microsoft.com/en-us/library/ms141724(v=sql.100).aspx
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question