—如下是查询语句
–查询名称有退格键
select * from t_bd_item_info where charindex(char(8),item_name) > 0
go
–查询名称有制表符 tab
select * from t_bd_item_info where charindex(char(9),item_name) > 0
go
–查询名称有换行
select * from t_bd_item_info where charindex(char(10),item_name) > 0
go
–查询名称有回车
select * from t_bd_item_info where charindex(char(13),item_name) > 0
go
–查询名称的空格(前空格、后空格、所有空格)
select * from t_bd_item_info where isnull(charindex(‘ ‘,item_name),0) > 0
go
–查询名称的单引号
select * from t_bd_item_info where charindex(char(39),item_name) > 0
go
–查询名称的双单引号
select * from t_bd_item_info where charindex(char(34),item_name) > 0
go
–处理名称有退格键
update t_bd_item_info set item_name = replace(item_name,char(8),”)
where charindex(char(9),item_name) > 0
go
–处理名称有制表符 tab
update t_bd_item_info set item_name = replace(item_name,char(9),”)
where charindex(char(9),item_name) > 0
go
–处理名称有换行
update t_bd_item_info set item_name = replace(item_name,char(10),”)
where charindex(char(10),item_name) > 0
go
–处理名称有回车
update t_bd_item_info set item_name = replace(item_name,char(13),”)
where charindex(char(13),item_name) > 0
go
–处理名称的空格(前空格、后空格、所有空格)
update t_bd_item_info set item_name = replace(rtrim(ltrim(item_name)),’ ‘,”)
where isnull(charindex(‘ ‘,item_name),0) > 0
go
–处理名称的单引号
update t_bd_item_info set item_name = replace(item_name,char(39),”)
where charindex(char(39),item_name) > 0
go
–处理名称的双单引号
update t_bd_item_info set item_name = replace(item_name,char(34),”)
where charindex(char(34),item_name) > 0
go
© 版权声明
博主的文章没有高度、深度和广度,只是凑字数。利用读书、参考、引用、抄袭、复制和粘贴等多种方式打造成自己的纯镀 24k 文章!如若有侵权,请联系博主删除。
喜欢就点个赞吧