Importing Text files to Tables

  • Hi Everyone,

    I am very new to SSIS 2005, this will be my first poroject if i complete it successfully and i dont' have any training either, but iam learning through built in tutorials. I have a situation where in i need to pull the latest data from text file insert into tables.

    In detail, for example i have a text file t1.txt this file get updated every second, once it reaches 977KB size it will be renamed to t1.tx0. And then system will create t1.txt again, once it reaches 977KB it will remaned to t1.tx1. My job is to design SSIS pacakge to get latest data from t1.txt file insert into table. Table should be updated every one minute with latest data, that means i have to schedule package every one minute. If some one could explain me whether this is possible from SSIS 2005..? if yes your valueable advise will be much appreciated.

    Note : Don't have to worry about renamed files, all i have to do is get data from t1.txt file,the filename remains same.

    Thanks again

  • Yes you can do it, but your package will need to be more complex as you will not be able to just do an insert. You will need a lookup on the key fields so you do not insert rows multiple times, then take the error output (configure your error output to redirect row) and use that to insert new rows into the table. So your flow would be:

    Text File Source -> Lookup to check for existence -> Lookup Error Output to Table

    If rows can be updated you could take the Default output from the lookup and do the update using an OLE DB Command transform.

  • Thanks Jack, appreciate your help. I will try that and let you know.

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

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