且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

SSIS 转换——将一列拆分为多列

更新时间:2022-12-11 19:49:31

您将需要在此过程中使用派生列.

You are going to need to use a derived column for this process.

SUBSTRING 和 FINDSTRING 函数将是实现这一目标的关键.

The SUBSTRING and FINDSTRING functions will be key to pull this off.

要获得第一个片段,您可以使用以下方法:

To get the first segment you would use something like this:

(DT_STR,25,1252) SUBSTRING([fullpatientname], 1, FINDSTRING(",",[fullpatientname],1)-1)

(DT_STR,25,1252) SUBSTRING([fullpatientname], 1, FINDSTRING(",",[fullpatientname],1)-1)

上面应该显示一个从 [fullpatientname] 开头到逗号 (,) 之前位置的子字符串.

The above should display a substring starting with the beginning of the [fullpatientname] to the position prior to the comma (,).

下一段是从逗号后面的位置到最后一个空格分隔符,最后是从最后一个空格分隔符后面的位置到结尾的所有内容.

The next segment would be from the position after the comma to the final space separator, and the final would be everything from the position following the final space separator to the end.