?
Solved

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

Posted on 2012-04-02
2
Medium Priority
?
224 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
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.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Suggested Courses

752 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