declare @i int, @temp nvarchar(1), @return nvarchar(1000),@str varchar(1000);
set @i = 1;
set @return = '';
SET @str='稿费,fccd.Fina_CCEditingFee 其他编辑费,fccd.Fina_CCCopyrightFee 版权费,0 照排费,
0 制版费,fccd.Fina_CCPrintingCosts AS 印刷费,fccd.Fina_CCRawMaterialsFees AS 材料费,0 光盘成本费,
fccd.Fina_CCReformBookCosts 改造书成本费,fccd.Fina_CCEntryFees 编录经费,fccd.CarryforwardYear 结转年,fccd.CarryforwardMonth 结转月,
RTRIM(fcc.Fina_CCEditor) 责编';
while @i <= len(@str)
BEGIN
set @temp = substring(@str, @i, 1);
if not (@temp >= 'a' and @temp <= 'z' or @temp >= 'A' and @temp <= 'Z'or @temp >= '0' and @temp <='9' OR @temp=',' OR @temp='.' OR @temp='_')
set @return = @return + @temp;
set @i = @i + 1;
end
PRINT @return
转载自原文链接, 如需删除请联系管理员。
原文链接:SQL 去掉字符串中的字母,数字和符号,转载请注明来源!