March 4, 2020 at 4:02 pm
I have a foreach (of type=file) loop , and I have the variable mapping set to return the 0 index to a variable called strfilename.
I then have a filesystemtask inside of this. For the type, I have Move file. IsSourcePathVariable=true, SourceVariable=strfilename.
This thing ought to run like a charm. But it tells me "Error at File System Task [File System Task]: Variable "strfilename" is used as a source or destination and is empty.". But why? at run time, this variable should be being filled by the ForEach loop. What am I doing wrong here?
March 4, 2020 at 4:08 pm
Difficult to help without knowing more. Can you provide screenshots of the config of your Foreach container?
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
March 4, 2020 at 4:33 pm
Looks OK to me!
What is the scope of variable strfilename?
You could try adding a pre-execute breakpoint to your FST (click once on it to select and then press F9). Then execute again and, when execution hits the breakpoint it will pause, allowing you to check the values of all of your local variables for possible clues.
--Edit: I see that you've already answered the Scope question.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
March 4, 2020 at 4:36 pm
For your future reference, note that you can also display images in-line, like so
Which helps reduce the amount of clicking for people viewing the post.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
March 4, 2020 at 4:46 pm
oh ok, thanks. I tried pasting a copied bitmap but didn't work so i assumed i couldn't.
ok so i think i solved it ... your answer that it looked OK sparked my mind to the answer so I appreciate it! - all I did was put delayvalidation to True for the FST and now it works. it was stuck trying to validate the source file. interesting - there are other ssis functions that don't behave that way, i guess you never know.
March 4, 2020 at 4:49 pm
Well done. My debugging idea would also have helped you get to this ... and in future, I suggest that you learn to watch out for validation errors vs runtime errors.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
March 4, 2020 at 4:51 pm
good advice, thanks
Viewing 12 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply