SSIS File Import by Directory

Posted on 2009-02-22
Last Modified: 2013-11-10

I have an SSIS packae that imports a flat file into a database.  I'm wondring how I might improve it so that it can append several flat files from one directory into the same database table in one fell swoop.  These files are not named similarly, but they do have the same extension.
Question by:NigelRocks
    LVL 17

    Accepted Solution

    If  by append you mean combine the files into one big file before loading, sure - using DOS commands. But I would not, just use the Foreach Loop Container and loop over all o fthe files. I would guess your performance will be better using the Foreach Loop vs. combining the files together.
    LVL 1

    Author Comment

    I'm using a for each loop container, but it's only reading the first file in the directory.  All I've done is create the object and point it to the directory.  What's my next step?
    LVL 17

    Assisted Solution

    LVL 1

    Author Comment

    Not really.  I awarded points the last time we visited this because I'm tired of being harassed by this site every time I have a question that's 5 seconds overdue.  I wondered if this would be different because I was not going to give the files any name, nor was I going to use any variables.
    The short answer is that you set up the container, point to a directory with the files, and then drag and drop a data flow task into the container that writes one of the files into a table.  
    For someone new to this paradigm, describing setting up a data flow task inside the container would lead many to double-click the container and look for prompts that allow this.  I realize now this is not the case.
    I have it working fine with the simple drag and drop steps outlined above.  Where do variables come in?  I didn't see any reason to set up any variables.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
    Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
    Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
    Via a live example, show how to shrink a transaction log file down to a reasonable size.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now