sql server - SSIS: Data transform delimited rows to field -


i have got table containing rows of related data need transform within ssis package , not sure how go it.

in table rows related each other separated row contains pipe character e.g.

test line 1_1
test line 1_2
test line 1_3
|
test line 2_1
test line 2_2
test line 2_3
|
test line 3_1
test line 3_2
test line 3_3

etc..

i need move table , concatenate lines of each group of rows 1 line separated pipe delimiter. above example need end in table:

test line 1_1 test line 1_2 test line 1_3
test line 2_1 test line 2_2 test line 2_3
test line 3_1 test line 3_2 test line 3_3

i not sure how it. thought exporting text file reimporting using pipe delimiter - work dealing millions of rows , rather aviod overhead, there must way in ssis @ moment not sure how.

any appreciated, thanks.

you can create data flow task uses source component. source retrieve data sql statement.

then, add script component transformation. script component must set asynchronous. select inputs , outputs tab of script component, , select output 0. set synchronousinputid none. allow component output different number of rows number of rows input. add new column below output columns branch.

in script component, can concatenate data wish. default, input buffer row , output buffer output0buffer. can use row.nextrow() next input row , output0buffer.addrow() add new output rows.

given sample data, can add input data output buffer until '|' appears. or, can use counter if fits data.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -