SQL 替换

--退格键

update A
SET objname= REPLACE(objname, CHAR(8), '') where charindex(char(8),objname) > 0

--tab

update A
SET objname= REPLACE(objname, CHAR(9), '') where charindex(char(9),objname) > 0

--换行  

update A
SET objname= REPLACE(objname, CHAR(13), '') where charindex(char(13),objname) > 0

--回车

update A
SET objname= REPLACE(objname, CHAR(10), '') where charindex(char(10),objname) > 0

--空格 

update A
SET objname= REPLACE(objname,' ', '') where isnull(charindex(' ',objname),'')) > 0

--单引号

update A
SET objname= REPLACE(objname, CHAR(39), '') where charindex(char(39),objname) > 0

--双引号 

update A
SET objname= REPLACE(objname, CHAR(34), '') where charindex(char(34),objname) > 0

posted @ 2022-04-14 09:40  何华荣  阅读(348)  评论(0编辑  收藏  举报