Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6731425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:31:38+00:00 2026-05-26T10:31:38+00:00

I need to visit a folder and all of its children with SSIS (SQL

  • 0

I need to visit a folder and all of its children with SSIS (SQL Server Integration Services). At the moment by setting the folder path into a variable after reading it, I able to loop through all the .txt files of the current folder and fill a pre-generated (with head info) xml file.

What I would need now is to be able to create one per each accessed folder, a new xml file (the beginning content will be always the same). Once I would be able to create it, as first action once a new folder is accessed, I can then simply apply the logic I developed so far.

However I am blocked at the moment, since within the loop where i read the files (with their full path) I cannot find a way to express “create the xml file if the accessed folder is new”.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:31:38+00:00Added an answer on May 26, 2026 at 10:31 am

    Assuming I understand the problem, you need to walk the entirety of a directory structure and for each folder you find, you need to create a base XML file. Then for each text file you find in that folder, you will perform some operation on the XML file. The trick being how do you only create the XML file once.

    enter image description here

    I would envision a process like this.

    A script task that makes use of the System.IO.GetDirectories to populate a variable (directoryXML> that contains the folder structure, something like

    <Dir>
        <D>C:\ssisdata</D>
        <D>C:\ssisdata\a</D>
        <D>C:\ssidata\a\b</D>
    </Dir>
    

    Use a Foreach Nodelist Enumerator to shred that XML out into a variable (currentDirecotry).

    You’d perform your one-time task of creating the XML file in currentDirectory.

    Further using the currentDirectory variable as an expression on the Foreach File Enumerator (assign to Directory with a FileSpec of *.txt) you can then perform your task on all the files meeting that specification. Do not check the traverse subfolder option as that will not give the desired results.

    This is a fairly high level approach to the problem as I’m assuming you have some familiarity with SSIS but the approach should be sound. Let me know if you have any particular sticking points.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The way my site is setup, I need to manually visit two URLs to
I need to redirect a user to a different page if they visit a
Need to insert selected text on the page into textarea. There must be some
Sometimes I visit a website with Chrome and get a message that I need
I need to retrieve some info from web. For example, I can visit weather.com
I need the community's help on this. We have TFS 2010 and SharePoint services
So is this : cursor.execute(Insert INTO visit (pid, date, diagnosisid) VALUES (%s,%s,%s), (pid, date,
i need to visit a secure web service, every request in the header need
Hai friends I need user country when they visit my php website. According to
To keep things brief I need to direct you to my website. Please visit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.