Split a single column of data with comma delimiters into multiple columns in SSIS

后端 未结 2 735
暗喜
暗喜 2020-12-06 20:39

I have a table in SQL Server with 3 columns, one of which is a data column containing rows of concatenated columns delimited by commas. The first row is also the header row

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-06 21:20

    You can use the Token expression to isolate strings delimited by well, delimiters.

    Use a derived column transformation and something like this:

    TOKEN([Name_of_your_Column], "," , 1)

    Should give you "a"

    TOKEN([Name_of_your_Column], "," , 2)

    Should give you "b"

    You can also set up a simple transformation script component. Use your "DATA" column as an input and add as many outputs as you need. Use the split method and you're set.

    string[] myNewColumns = inputColumn.split(",");

提交回复
热议问题