SQLTeam.com | Weblogs | Forums

Format email


#1

Hello All,
Need some help with the below situation.
if the email column does not contain an email address properly formatted with a (@J-Mcom.com) set it to this Test.ServiceRequest@J-Mcom.com

Thank you


#2

this ?

UPDATE  yourtable
SET     email = 'Test.ServiceRequest@J-Mcom.com'
WHERE   email NOT LIKE '%@J-Mcom.com'

#3

Thanks Khtan,even I am using the same thing.
Do you think this will work in all the scenarios?
or is there any other alternate that would work in all the scenarios?

Thanks


#4

it does not handle NULL on email column. Add that condition if you have such case


#5

I am handling the NULL's in the before step,so this column will not have any NULL's


#6

Weirdo data elements:
MyEamil@YourEmail@J-Mcom.com This is invalid but won't get flagged. (Multiple @ characters)
@J-Mcom.com This is invalid but won't get flagged. (No name prefix)
MyEmail @J-Mcom.com This is invalid but won't get flagged. (Blanks characters in the email address)
Invalid characters in the name

How bulletproof do you want the test to be?