about importing files in particular folder and export them to different tables based on file name

  • hi

    this sridhar, iam new to ssis2008

    i have task like:

    i have a local folder to which daily new 4 .txt files are received the part of the file names like (something)_condo_(somthing),

    (somthing)_res_(somthing),

    (somthing)_inc_(somthing),

    (somthing)_ind_(somthing)

    these type of files may have many

    so i have a task like loop through the every file in the folder and export them to different tables based on the part of the file name i have to export to certain table.

    so how can i do this can any one help me out? 🙂

  • [font="Comic Sans MS"]

    I guess the files have same extension like *.txt. Use for each loop to loop through files.

    Example

    Then you can use a script task to move the files to desired directory.

    Alternatively:

    Use execute file system task depending on the fileWeJustFound variable value found in the example above.

    [/font]

    [font="Comic Sans MS"]--
    Sabya[/font]

  • i gone through the u r example it is very helpful how to start but after getting the value into the filejustfound

    how can i dynamically assign a file to flat file source and how can i decide dynamically the table name.

    can you explain me briefly?

  • sridharparshi (6/26/2010)


    how can i dynamically assign a file to flat file source and how can i decide dynamically the table name.

    You can't dynamically assign a file to a source. Everything must be set-up during design time. So, if you have 4 different file types, you must set-up 4 different data flows.

    If the file format is the same for all the files, then you can use one data flow. Configure everything (connection string to source file and destination table) through expressions.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • all the files are with .txt extension and having different structure

    based on the file it destination should change.

    thanks 🙂

  • use 4 DFD's and enable the required DFD and disble the rest on the fly...

    or use BCP as some one suggested in other thread....

    RB

  • thank you for your replay

    i am new to ssis

    can you elaborate what your saying

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

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