Link to home
Start Free TrialLog in
Avatar of AlfredBaker
AlfredBaker

asked on

Split a Single Column into Multiple Columns in SSIS

Hi Experts, I have a Source table which has one Column and the values in the Column are Pipe Seperated
Ex: 1234|5678|91012|abc|def|ghij|klm|nop

I have to split this column into multiple columns and then populate it into a target table.

I have to Split the Column Whereever I find a Pipe symbol. How can I do this using SSIS. Any help or suggestion is highly appreciated.

Thanks
Avatar of Irek Piwowarek
Irek Piwowarek

Some suggestions assuming that maximum number of new columns is well known.
1. Use Derivates columns component and together with expressions crate always maximum number of columns using substring, findstring or better to use TOKEN (from SQLServer2012) function (http://technet.microsoft.com/en-us/library/hh213216.aspx)
2. Use Script component and split string there using C# or VB and assign to variables which you can assign in derivate columns. With script you can better control any extreme cases like no data, only one column etc.
Hope that helps.
Avatar of AlfredBaker

ASKER

Thanks for the suggestion Irek, In my case i dont have a definitive number of columns. What can be done in this case.
ASKER CERTIFIED SOLUTION
Avatar of Irek Piwowarek
Irek Piwowarek

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial