Foreach Loop still executes after process and delete all the folders

  • I have two challenges

    1. XML source control not displaying the XML file parent node columns even though it is showing in the XSD file. Is there any solution to get the XML parent nodes columns in the XML source component.
    2. Foreach loop container control not stopping. it still executes if more than two files in the folder. all the files are in the folder. Inside the foreach loop, script task control to get the file and folder names and Execute sql task to insert the XML file(s) into sql server.Last control again script task to delete the executed file. Outside the foreach loop, another script task to delete the folders. But after deleting the folders for loop still running. not showing the green tick sign for the delete folder script task. it continues for a while.
  • File

    1. Maybe not. But there are likely options, such as (a) Using a Script Component source & writing some C# to decipher the XML and output the columns, or (b) Bringing the entire XML into a SQL table and using XPath commands in T-SQL to shred the data.
    2. If you read the Execution Results window at the point where it seems to hang, is anything happening? What is the last thing that happens before it hangs?

    1. Yes, I used the Openrowset method to insert the XML data into sql table. But this process takes long time than the XML source method. XML source to Oledb destination is the fastest method
    2. SSIS package is running for a while. so, i always use the Task manager to End task the application. if it's less than five folders then it's qucikly execute and stop. if more than five folders then it's execute and running for a while. I even add another script task after the delete folder and write a script to fail the task. but still no luck. The screenshot which i attached is completely run, but the Green tick for the "Delete folder" task is not showing. when i check in the folders all the files folders are deleted. After doing this "Delete folder" task, for loop run again. I want to stop that.
    1. Then try the script component source method
    2. I have no idea why the FOREACH container would run more than once, assuming your screenshot is representative of the entire package.

    Can you include a screenshot showing the config of the container?


  • Please check the attached document

    Attachments:
    You must be logged in to view attached files.

Viewing 6 posts - 1 through 6 (of 6 total)

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