Bulk import .txt files - SSIS

  • Hello All,

    I just started using SSIS in Visual Studio 2015. http://prntscr.com/b8du7x

    Overview:

    a. I have a table with 1 column of data type XML:

    CREATE TABLE [dbo].[OUTSTANDING](

    [XMLDATA] [xml] NULL

    )

    b. I have a folder containing text files all with different names. These text files contain similar structure XML data in them.

    What i would like to achieve:

    I would like to read all these text files using SSIS method and input their data row by row in the table.

    I.E. Row 1 in the table contains all of textFile1.txt data, row 2 in the table contains all of textFile2.txt data, etc

    I have created: "Dataflow Task -> Flat File Source" but it's only allowing me to input a specified text file name (note that i have multiple differently named text files).

    Sincerely,
    Leon CLF
    DB Administrator

  • You need to set up a for each container to iterate over the .txt files in your directory. Here's an example of how to set that up.

    http://www.sqlis.com/sqlis/post/Looping-over-files-with-the-Foreach-Loop.aspx

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

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

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