SSIS ForEach Loop Container for XML Files with mixed content

  • Hello,

    (can't upload images into body, neither .png or .jpg, size is less then 1024KB)

    My goal is to read data from XML files into SQL table. The main issue is that those XML files have mixed content that is not supported through XML Source. To overcome this issue i used XML Task with XSLT Operation Type on Input as follows:

    SSIS XML to SQL

    And then simply Data flow tasks to transfer data to SQL Server:

    SSIS XML to SQL2

    Up to this point (for one file) the solution works.

    But i have more files then one so i would like to use ForEach Loop Container but i just can't configure it to make it work. I'm trying to loop over XML Files and pass files to XML Task:

    SSIS XML to SQL3

    Configuration of a container:SSIS XML to SQL4

    I used two variables:

    varSourceFolder - assigned to Directory expression (points to source with xml files)

    FileName - should be used to get file name from enumeration.

    Then in XML Task i'm using one more expression assigned to Source property which concatenates two previous variables varSourceFolder+FileName.

    SSIS XML to SQL5

    But it seems that each time variable FileName is empty.

    I've tried a lot of things, no success. I would much appreciate your help.

    Regards,

    Luk

  • Thanks for posting your issue and hopefully someone will answer soon.

    This is an automated bump to increase visibility of your question.

  • Not sure if you got this figured out yet but it looks like the issue is your XML Task has a hardcoded SOURCE file. That needs to be a variable that the Loop Container populates so you get the new file name each time.

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

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