Search code examples
foreachssis

Failure to find SSIS variable in For Each Loop


I'm an experienced SQL user, but have limited exposure to creating SSIS packages. I'm putting together a package to transform and upload multiple log files, to iteratively select files from the source location.

To do this, I have used the following in-depth tutorial: How do I move files to an archive folder after the files have been processed?

I have followed every step and applied it to my package but get the following errors:

Error: 0xC00470A6 at Package: The variable "User::FilePath" was not found in the Variables collection. The variable might not exist in the correct scope.

Error: 0xC0047098 at Package: Attempt to parse the expression "@[User::FilePath]" failed and returned error code 0xC00470A6. The expression cannot be parsed. It might contain invalid elements or it might not be well-formed. There may also be an out-of-memory error.

I have rebuilt the package from scratch, ensuring I've dragged the variable names into the expressions, however the same error still persists.

Really unsure how to proceed now, and would appreciate any pointers!

[EDIT] - Just pointing out that I'm using SSIS in VS 2013 - and there are now 'parameters' as well as 'variables', I was wondering if this could potentially be the issue - e.g. the variable needs parametrizing? Reasoning: When I go to the 'Expression Builder' for the Flatfile connection properties, there is no variables in the list, however there is an empty 'Project Parameters' folder when you'd normally pull the variable references from.


Solution

  • Figured it out, so thought I'd post this here to help anyone else who finds themselves in the same situation!

    Under the Control Flow tab, right click the Connection Manager, and select "Convert to Project Connection" - this allows access to all the runtime variables for the specified package.

    Simple when you know what you are doing.