SQL中英文标点转换
create function c1toc2(@c3 nvarchar(1000))returns nvarchar(1000)asbegin--declare @c1 nvarchar(30),@c2 nvarchar(30)--set @c1='~!◎#¥%……※×()_+;‘:“,。、《》?【】『』'--set @c2='~!@#$%^ *()_+;'':",./ ?[]{}'select @c3=stuff(@c3,number,1,substring('~!@#$%^ *()_+;'':",./ ?[]{}',charindex(substring(@c3,number,1),'~!◎#¥%…※×()_+;‘:“,。、《》?【】『』'),1))from master..spt_values where type='p' and number between 1 and len(@c3) and charindex(substring(@c3,number,1),'~!◎#¥%…※×()_+;‘:“,。、《》?【】『』') 0set @c3=replace(@c3,'^^','^')return @c3endgodeclare @c nvarchar(1000)set @c='你好,今天是周未!(你)吃过没有?他说:“你今天很漂亮……”(){}:“》《。,这两本书很有意思。'select dbo.c1toc2(@c)godrop function dbo.c1toc2