TSQL Email Validation (without regex)
问题 Ok, there are a million regexes out there for validating an email address, but how about some basic email validation that can be integrated into a TSQL query for Sql Server 2005? I don\'t want to use a CLR procedure or function. Just straight TSQL. Has anybody tackled this already? 回答1: Very basic would be: SELECT EmailAddress, CASE WHEN EmailAddress LIKE '%_@_%_.__%' AND EmailAddress NOT LIKE '%[any obviously invalid characters]%' THEN 'Could be' ELSE 'Nope' END Validates FROM Table This