SSIS删除双引号内的单引号 [英] SSIS removing single quote within double quotes

查看:123
本文介绍了SSIS删除双引号内的单引号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个派生的列,该列将删除包含在双引号中的字符串周围的单引号。例如:

I am attempting to create a derived column that will remove single quotes surrounding a string that is also contained within double quotes. For example:

"Robert 'Bob' LaBla"

我只需要删除 Bob 周围的单引号,以使结果为:

I need to remove just the single quotes around Bob so that the outcome is:

"Robert Bob LaBla"

尝试了 REPLACE(Column, \,)可以完美删除双引号,但用单引号替换此表达式似乎不起作用,我宁可不必编写

Tried REPLACE(Column,"\"","") which removes the double quotes perfectly but replacing this expression with single quotes doesn't seem to work. I'd rather not have to write a script for this. Any help is appreciated.

推荐答案

要删除派生列中的单引号,只需使用以下表达式:

To remove single quotes in derived column just use the following expression:

REPLACE(Column,"'","")

如果您需要删除两个引号,则

If you need to remove both quotes then

REPLACE(REPLACE(Column,"\"",""),"'","")

参考文献

  • how to replace quotation marks in a derived column?
  • REPLACE (SSIS Expression)

这篇关于SSIS删除双引号内的单引号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆