Solved

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

Posted on 2012-04-02
2
218 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
2 Comments
 
LVL 37

Accepted Solution

by:
ValentinoV earned 500 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Server Generate Scripts Fails 5 36
SQL Server 2012 r2 - Make Temp Table Query Faster 5 44
MS SQL with ODBC 5 36
Run SQL Server Proc from Access 11 31
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
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…

809 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