SQL server - how to find Hexadecimal character in a table

How to search hexadecimal characters from a SQL Server table? Actually I tried like below but it is searching all zeroes in the field.

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

Thanks

Answers


I had a similar problem where a hexadecimal character was crashing a query. This is what I did to find it.

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

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


Need Your Help

Copying MongoDB Database into Local Machine

mongodb localhost local database

I have a MongoDB database that resides on a remote server machine whose IP address is 192.168.1.20 on a local network. For development and testing purposes, and since I am not allowed to modify or ...

What is first class function in Python

python function first-class-functions

I am still confused about what first-class functions are. If I understand correctly, first-class functions should use one function as an object. Is this correct?