Using SSIS to read a file directory and store info in SQL table

  • I simply wish to create an SSIS pkg that will read through a windows directory and grab the filenames of all the files and write them into a database (one filename per record). I'm still relatively new to SSIS so I'm not sure what the best way to do something like this would be. Any suggestions?

    Thanks!

    ~mj

  • Look for some information on the ForEach component. In the available enumerators, there is a ForEach File enumerator that you just point at a directory. It will loop through each file and put the file name or full path into a variable. From there, you can use an ExecuteSQL task to insert once per file found.

  • Thank you for the information Michael (and the prompt reply!) I will give that a try.

    MJ

    ---update: Using the ForEach Loop Container worked wonderfully for this! Thank you for the help!

    ~mj

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

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