Try using a cross join in a table containing a list of email addresses you want to find:
declare @email table(
email_check nvarchar(500) not null)
insert into @email(email_check)
values('jack@google.com')
insert into @email(email_check)
values('john.@google.com')
select hit, ID, EMAIL_ADDRESS from (
select CHARINDEX(email_check, lower(EMAIL_ADDRESS)) hit, ID, EMAIL_ADDRESS
from Table_With_Email_Addresses
,@email
) t
where hit > 0
No need to “seem like”, because it will parse the string to find a match. Hooray!
source
share