Hi
I came across this thread on validating email addresses in SQL and wondered if i could use the same to remove invalid email addresses before importing to the data model.
sql server - TSQL Email Validation (without regex) - Stack Overflow
My current query is
but just adding
says incorrect syntax. Also I don't want to throw out the entire record which I think this would do, but just the CTEmail field to be blank.
any suggestions as how to achieve this appreciated as don't think DAX is as powerful finding these types of errors.
Mike
I came across this thread on validating email addresses in SQL and wondered if i could use the same to remove invalid email addresses before importing to the data model.
sql server - TSQL Email Validation (without regex) - Stack Overflow
My current query is
Code:
select distinctINVNUM,Sysdate,Invdate,
Depot,
Customer,
"GROUP",
CTSalut,CTFirstn,CTSurname,Name1,
Addr11,Addr12,Addr13,Addr14,
Pcode1,
Phone1,
CTPhone,
CTMobile,
CTEmail,
Advert,TType,CUSREC,
RegNum,DVMake,DVModel,DVDate,MOTDue,ServiceDue,CTCampaign,CTCampRef
from dbo.VW_InOutStock
where invnum<>'07C38213'
and
invdate<'2015-07-01'
but just adding
Code:
ANDWHERE CTEmail LIKE '%_@__%.__%'
AND PATINDEX('%[^a-z,0-9,@,.,_]%', REPLACE(CTEmail, '-', 'a')) = 0
says incorrect syntax. Also I don't want to throw out the entire record which I think this would do, but just the CTEmail field to be blank.
any suggestions as how to achieve this appreciated as don't think DAX is as powerful finding these types of errors.
Mike