sql 中英文标点符号转换

 1 create function fn_ConvertPuntuation(@c3 nvarchar(3000))
 2 returns nvarchar(3000)
 3 as
 4 begin
 5     select @c3=stuff(@c3,number,1,substring('~!@#$%^&*()_+;'':"",./<>?[]{}',
 6     charindex(substring(@c3,number,1),'~!◎#¥%…※×()_+;‘:“”,。、《》?【】『』'),1))
 7     from master..spt_values 
 8     where type='p' and number between 1 and len(@c3) 
 9     and charindex(substring(@c3,number,1),'~!◎#¥%…※×()_+;‘:“”,。、《》?【】『』')>0
10     set @c3=replace(@c3,'^^','^')
11     return @c3
12 end

 

posted @ 2023-02-27 15:39  每天进步多一点  阅读(253)  评论(0编辑  收藏  举报