sqlserver 中含有某字符串
查找 sqlserver 中字符串的ascii码
SET TEXTSIZE 0
-- Create variables for the character string and for the current
-- position in the string.
DECLARE @position int, @string char(8)
-- Initialize the current position and the string variables.
SET @position = 1
SET @string = '—销售定转子冲片及转子齿压板等(北京三一)'
WHILE @position <= DATALENGTH(@string)
BEGIN
SELECT ASCII(SUBSTRING(@string, @position, 1)),
CHAR(ASCII(SUBSTRING(@string, @position, 1)))
SET @position = @position + 1
END
GO
发现特殊字符char(31),单元间隔符
查找sqlserver中是否含有该特殊字符
两种方案
select * from GL_accvouch where cdigest like '%'+ char(31)+'%'
select * from GL_accvouch where CHARINDEX(CHAR(31),cdigest)<>0
或者使特殊字符显示出来
select REPLACE(cdigest,char(31),'xx'),* from gl_accvouch
最后替换特殊字符
【推荐】鸿蒙应用开发者激励计划,开发上架应用,现金激励超亿元!
【推荐】园子的不务正业:向创业开发者推荐「楼盘」- 杭州云谷中心
【推荐】2025 HarmonyOS 鸿蒙创新赛正式启动,百万大奖等你挑战!
【推荐】电信天翼云 2025 云上钜惠,爆款云主机2核4G只要1.5折起