想要问一种在我的专栏产品标题中找到并替换长的Hypen的方法,
样品名称:冷冻 - 肉类xxxx xxxxx xxxx
想要在将其传递到我们的最终数据库之前删除长期的宣传
结果应如下所示:
INSERT INTO [Product].[Market].[Products]
([ProductId]
,[ProductSourceCd]
,[ProductTitle])
SELECT MP.([ProductId]
,MP.[ProductSourceCd]
CASE MP.[ProductTitle]
WHEN '' THEN REPLACE(ProductTitle," – "," ")
答案 0 :(得分:0)
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 ('–')