mikiyaaaaa
mikiyaaaaa

Reputation: 1

SSIS - How to write line by line into flat file using ForEach Loop Container

I need to get data from table and write it into flat file line-by-line.

Example File 1:

Alice   ID  ST-01
Alice Gender    F
Alice   Subject English 69
Alice   Grade   C
Alice   Subject Mathematics 85
Alice   Grade   A
Alice   Subject Biology 44
Alice   Grade   D
Alice   Subject Geography   91
Alice   Grade   A
Alice TotalSubject  4

Example File 2:

Mandy   ID  ST-02
Mandy Gender    F
Mandy   Subject English 90
Mandy   Grade   A
Mandy   Subject Mathematics 63
Mandy   Grade   C
Mandy   Subject Geography   82
Mandy   Grade   A
Mandy TotalSubject  3

Example File 3:

John    ID  ST-03
John Gender M
John    Subject English 71
John    Grade   B
John TotalSubject   1

So from the example you may see that the value of TotalSubject affecting how many rows of Subject and Grade shown in file, and all file only have ONE row of ID/ Gender/ TotalSubject.

My question is, how can I use ForEach Loop Container in SSIS to get data from table and write it into flat file line-by-line?

Please do suggest me for solution, or other idea using ScriptTask. Thanks in advance.

Upvotes: 0

Views: 53

Answers (0)

Related Questions