Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting a string with multiple lines into multiple rows with 1 line

Status
Not open for further replies.

smn198

Technical User
Oct 29, 2004
24
0
0
GB
Hello!

I've just picking up SSIS but I've run into a problem where I want to do some non-standard string manipulation. I've got a data source with 2 columns. ID and data. The data column is a string but has multiple lines within it seperated by return characters. I would like each line of data to have its own ID with the corrosponding ID.

It currently looks like this:

[tt]ID Data
==========
1 Jack
Jane
Jill
----------
2 Adam
Anita
Anne
----------
3 Bill
Betty[/tt]

And I want it to look like this:
[tt]ID Data
==========
1 Jack
----------
1 Jane
----------
1 Jill
----------
2 Adam
----------
2 Anita
----------
2 Anne
----------
3 Bill
----------
3 Betty[/tt]

I think I need to use a script transform but I'm not really sure how to go about doing that. Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top