Problem concatenating ssis variables using an Expression task inside a for each loop

  • Hey guys, I have 2 ssis variables Im using in order to send a notification email. I have a for each loop using another ssis variable of type object to loop through the file names inside it. The variable mapping is to an ssis variable called Current_File which is of type string. Inside the Expression task I have the following:

    @[User::Email_Body] =  @[User::Email_Body] +  @[User::Current_Filename] +  @[User::NewLine]

    My problem is that the Email Body isn't getting updated. This has been working for a while but for some reason it stopped

  • dndaughtery - Monday, January 30, 2017 9:28 AM

    Hey guys, I have 2 ssis variables Im using in order to send a notification email. I have a for each loop using another ssis variable of type object to loop through the file names inside it. The variable mapping is to an ssis variable called Current_File which is of type string. Inside the Expression task I have the following:

    @[User::Email_Body] =  @[User::Email_Body] +  @[User::Current_Filename] +  @[User::NewLine]

    My problem is that the Email Body isn't getting updated. This has been working for a while but for some reason it stopped

    Perhaps it's because the variable is called Current_Filename rather than Current_File?

    At what point in the process is Email_Body initialised? In the above, it is just being augmented.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • I figured it out. I set the initial value in the Email_Body variable in the variables window when I should have just did the concatenation and inserted the message in the Send Email tasks expression

  • dndaughtery - Monday, January 30, 2017 9:46 AM

    I figured it out. I set the initial value in the Email_Body variable in the variables window when I should have just did the concatenation and inserted the message in the Send Email tasks expression

    Out of interest are all of the files in the same folder?

    If so you could use the For Each Loop mapped to the folder and limked to a variable to store the currentFileName This could simplify your design.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply