Hi All...
I'm wanting to check for invalid email addresses.
the rules I have so far =
SELECT Count(*) FROM FileName where
Email Not Like '%@%.%'
or Email Like '%@%@%'
or Email Like '%.'
or Email is Null
or Email like '% %' (theres a space in there)
and this catches most of them. I'm just wondering if theres a better way to do it...
so that rather than trying to catch all the wrong ones I'm only looking for the right ones...
The following is a regular expression (in PHP I think) for valid email addressses... can I do similar with SQL?
ereg("(.*)@(.*)(\.)(.*)",$string)
I've read a little on PATINDEX but it seems to need % as well so its similar to my current statements..
Any ideas?
Thanks

I'm wanting to check for invalid email addresses.
the rules I have so far =
SELECT Count(*) FROM FileName where
Email Not Like '%@%.%'
or Email Like '%@%@%'
or Email Like '%.'
or Email is Null
or Email like '% %' (theres a space in there)
and this catches most of them. I'm just wondering if theres a better way to do it...
so that rather than trying to catch all the wrong ones I'm only looking for the right ones...
The following is a regular expression (in PHP I think) for valid email addressses... can I do similar with SQL?
ereg("(.*)@(.*)(\.)(.*)",$string)
I've read a little on PATINDEX but it seems to need % as well so its similar to my current statements..
Any ideas?
Thanks