替换 SSIS 代码中的长连字符(查找和替换)
Replacing long Hypen in SSIS code (Find and Replace)
想问一下如何在我的专栏产品标题中找到并替换一个长的Hypen,
样本Productname:Frozen – 肉 xxxx xxxxx xxxx
想在将长的 hypen 传递到我们的最终数据库之前删除它
结果应如下所示:
INSERT INTO [Product].[Market].[Products]
([ProductId]
,[ProductSourceCd]
,[ProductTitle])
SELECT MP.([ProductId]
,MP.[ProductSourceCd]
CASE MP.[ProductTitle]
WHEN '' THEN REPLACE(ProductTitle," – "," ")
NCHAR(8211)
表示短划线,NCHAR(8212)
表示短划线。
INSERT INTO Product.Market.Products
(ProductId, ProductSourceCd, ProductTitle)
SELECT MP.ProductId, MP.ProductSourceCd],
REPLACE(MP.ProductTitle, N' ' + NCHAR(8211) + N' ',N' ')
FROM
...
如果您不确定字符是什么,请将 unicode 字符转换为整数值:
select UNICODE ('–')
想问一下如何在我的专栏产品标题中找到并替换一个长的Hypen,
样本Productname:Frozen – 肉 xxxx xxxxx xxxx
想在将长的 hypen 传递到我们的最终数据库之前删除它
结果应如下所示:
INSERT INTO [Product].[Market].[Products]
([ProductId]
,[ProductSourceCd]
,[ProductTitle])
SELECT MP.([ProductId]
,MP.[ProductSourceCd]
CASE MP.[ProductTitle]
WHEN '' THEN REPLACE(ProductTitle," – "," ")
NCHAR(8211)
表示短划线,NCHAR(8212)
表示短划线。
INSERT INTO Product.Market.Products
(ProductId, ProductSourceCd, ProductTitle)
SELECT MP.ProductId, MP.ProductSourceCd],
REPLACE(MP.ProductTitle, N' ' + NCHAR(8211) + N' ',N' ')
FROM
...
如果您不确定字符是什么,请将 unicode 字符转换为整数值:
select UNICODE ('–')