from multiple falt file to one sql table

  • Hello all,

    i want to load data in one sql server table.

    i have 56 different text files for different states and these text files have data inside them and i need to load these data in only one sql table.

    I can create an ssis package but then i have to create 56 different text file connections and union all and then insert to ole db destination which is very long.

    is there any shortcut u know abt how to perform this thing? like for each loop or bcp task? i dont know how to use these tasks so plz give me some more hint abt how to use.

    Thanks

  • Do all of the files have the same format? If so, you'll only need one file connection. You can use a For Each loop container to loop through a directory of files and import each file one-at-a-time.

    John Rowan

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

  • thanksa lot. I got that but one lil confusion. for one of my column values in text files are 00 but after running packkage i can see values as 0 (datatype-int in table) where should i change my datatype and wht so that i can see 00 type of result

    Thanks

  • For that value to be stored in the database as '00', it will need to be a char/varchar data type. I would question changing it through depending on what that data represents. If it truely represents an integer value, leave it as integer. If it is a 2 digit code of some sort, change it. Keep in mind that there is a difference in storaging the data and displaying the data. Store the data in the appropriate data type that correctly represents the data. Use logic in your stored procedures and views to display, or retrieve, the data in the format of your choice.

    John Rowan

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

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

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