SSIS 派生列从字符串中删除文本,仅保留数值

SSIS derived column remove text from string, keep only numeric values

我正在尝试从特定列中删除文本,只保留数值。我尝试使用派生列,也尝试搜索答案,但没有找到解决方案。

例如,table 看起来像这样:

order_number
1001
1002 k
1003
text
1004
aa 1007

我希望有人能帮我解决这个问题。提前致谢

这是我得到的错误:

您可以使用脚本组件(确保添加输出列 (outordernumber)):

if(!Row.ordernumber_IsNull){
    Row.outordernumber = System.Text.RegularExpressions.Regex.Replace(Row.ordernumber, "[^0-9]", "")
}else{
    Row.outordernumber_IsNull = true;
}   

我想你错过了这一步:

打包结果: