1. 程式人生 > >SQL查詢和替換含有回車,空格,TAB

SQL查詢和替換含有回車,空格,TAB

轉:https://blog.csdn.net/u010195563/article/details/82927984

---如下是查詢語句
--查詢名稱有退格鍵
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