Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

loop files script component:detect finishing last file read

$
0
0

Hi all,

How do I detect the finishing of reading of last file read in loop for each container

from a script component?

I want to update an external file of some state that was maintained thourgh the loop and should be printed once for all the files of this type in the folder.

For now, I am able to print it each time the script component is called and maintain the state  using variables, but how can I differentiate the end of the last time the sciprt is called so  to not to print the state each time, but only at the end of the run?

The script is currently has the following parts: pre-execute, post-execute, method that creates output rows (with readstream,  loop on lines in file , and try -catch-finally).

I tried to flag the streamreader in a way that  will indicate the there is no additional file

(after having at least one file read) and then to do something in the post execute, but

this doesn't get hit. Maybe something in the container scope?

Thanks a lot


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>