首页 > 数据库 >sql 中英文标点符号转换

sql 中英文标点符号转换

时间:2023-02-27 15:44:08浏览次数:41  
标签:中英文 number substring charindex 标点符号 sql c3 nvarchar 3000

 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

 

标签:中英文,number,substring,charindex,标点符号,sql,c3,nvarchar,3000
From: https://www.cnblogs.com/lgx5/p/17159931.html

相关文章