Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I can SEE the space in an email address, but SQL SERVER can't?

I am trying to clean up some email addresses in sql server. I can see examples of the problematic emails, and they look like this:

abc123 @xyz.com

However, when I try to run a query to find folks like these, say with:

NOT CHARINDEX(' ',LTRIM(RTRIM([Email_Address]))) = 0

or

Email_Address like '% %'

my query returns no results.

Any idea what gives?

Thanks for the quick answers. It was a Non-Breaking Space -- Char(160). The sql ASCII() function came in handy to find it.

like image 284
Tony Avatar asked Nov 28 '22 12:11

Tony


1 Answers

Is it definitely a space in there or could it be some other non-printing character?

like image 113
BlackWasp Avatar answered Dec 04 '22 08:12

BlackWasp