NEWS & TECH BLOG
Check email addresses
06/02/2017 – in GoldMine, SQL queriesHere’s a SQL query to check for invalid characters in email addresses in GoldMine:
select coalesce(contsupref+address1, contsupref),
patindex('%[^,a-z,A-Z,0-9,.,_,@,-]%',rtrim(coalesce(contsupref+address1, contsupref))) as [Position],
substring(rtrim(coalesce(contsupref+address1, contsupref)),patindex('%[^,a-z,A-Z,0-9,.,_,@,-]%',rtrim(coalesce(contsupref+address1, contsupref))),1) as [InvalidCharacter],
ascii(substring(rtrim(coalesce(contsupref+address1, contsupref)),patindex('%[^,a-z,A-Z,0-9,.,_,@,-]%',rtrim(coalesce(contsupref+address1, contsupref))),1)) as [ASCIICode]
from contsupp
where contact='e-mail address' and
patindex('%[^,a-z,A-Z,0-9,.,_,@,-]%',rtrim(coalesce(contsupref+address1, contsupref))) >0
This is a variation on Gerhard Weiss’ submission here