MS SQL 去除字段中的大小写英文、数字、特定符号
作者:互联网
这是要去除字段中的大小写英文、数字、特定符号
函数如下:
Create Function [dbo].[RemoveCharacters](@Temp VarChar(1000)) Returns VarChar(1000) AS Begin Declare @KeepValues as varchar(50) Set @KeepValues = '%[a-z,A-Z,0-9,%,/,=,-,#,,,:,;]%' While PatIndex(@KeepValues, @Temp) > 0 Set @Temp = Stuff(@Temp, PatIndex(@KeepValues, @Temp), 1, '') Return @Temp End
调用方法
Select dbo.RemoveCharacters('这是AB中文abv的0,1范例223')
标签:PatIndex,RemoveCharacters,dbo,Temp,SQL,字段,MS,KeepValues,VarChar 来源: https://www.cnblogs.com/CnKker/p/15686283.html