Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Help SSIS to import odd text file

Author  Topic 

rdickens
Starting Member

1 Post

Posted - 2014-07-10 : 12:35:37
I have a text file in an odd format that was created by a custom app for tracking serial numbers.

The format is:

ordernumber, numberofserial#s, serial1, serial2, etc...

Example lines:

1234, 2, 010101010101, 010101010102
1235, 1, 010101010103
1236, 4, 010101010104, 010101010105, 010101010106, 010101010107

I need SSIS job to daily truncate a table and repopulate with:

order, serial
order, serial

1234, 010101010101
1234, 010101010102
etc...

Any guidance appreciated.

Oh this is in SQL 2008 but no SSIS forum here for 2008.

Thanks!

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2014-07-11 : 12:32:53
Your best option is to use a script component to parse the data and output multiple rows. See http://beyondrelational.com/modules/2/blogs/106/posts/11126/ssis-script-component-split-single-row-to-multiple-rows.aspx for an example. Then you take that output and use it to build your table in SQL
Go to Top of Page
   

- Advertisement -