SQL server - how to find a hexadecimal character in a table

How to look for hexadecimal characters from a SQL Server table? Actually, I tried as shown below, but it searches for all zeros in the field.

select Email,* from address where CHARINDEX(convert(varchar, Ascii(0x00)), Email) > 0 

thanks

+6
source share
2 answers

I had a similar problem when a hexadecimal character reset the request. This is what I did to find him.

 select Email from address where Email like '%' + CHAR(0x00) +'%' 

Now, to stop bad data from getting in the first place ...

+23
source

Not sure if this page will be of any help with what you are trying to achieve.

http://www.codeproject.com/Articles/33941/SQL-LIKE-Operator

0
source

Source: https://habr.com/ru/post/922038/


All Articles