Categories

Follow our news:

Follow canonburysvcs on Twitter Follow Canonbury Services on Facebook Follow Canonbury Services' news by RSS Follow Canonbury Services' news by Atom Follow Canonbury Services' news by email

NEWS & TECH BLOG

Check email addresses

06/02/2017 – in GoldMine, SQL queries

Here’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

Share