AFAIK there is no good way to do this.
The email format standard is that parsers that are so complex are known to work with thousands of lines of code, but even if you have to use a simpler form that will crash some obscure but valid addresses that you would have to do without regular expressions, which T-SQL is not initially supported (again, I'm not 100% at that), leaving you with a simple reserve somethign like:
LIKE '%_@_%_.__%'
.. or similar.
My feeling, as a rule, you do not do this at the last possible moment (although you insert it into the database), you should do it at the first opportunity and / or a common gateway (the controller that actually makes the SQL insert query), where, by the way, you will have the advantage of regex, and perhaps even a library that does a βrealβ check for you.
annakata Jan 08 '09 at 9:04 2009-01-08 09:04
source share