Sql脚本查找无效的电子邮件地址 [英] Sql script to find invalid email addresses
本文介绍了Sql脚本查找无效的电子邮件地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
从访问数据库完成数据导入,并且电子邮件地址字段上没有验证。有没有人有一个sql脚本,可以返回无效的电子邮件地址列表(缺少@等)。
谢谢!
解决方案
SELECT * FROM people WHERE email NOT LIKE'%_@__%.__%'
更复杂的任何事情都可能会返回错误的负面影响,运行速度较慢。
编辑:相关问题
- 我之前曾回答过类似的问题: TSQL电子邮件验证(无正则表达式)
- T-SQL:检查电子邮件格式
- 正确地识别电子邮件地址难?
- 许多其他堆叠溢出问题
A data import was done from an access database and there was no validation on the email address field. Does anyone have an sql script that can return a list of invalid email addresses (missing @, etc).
Thanks!
解决方案
SELECT * FROM people WHERE email NOT LIKE '%_@__%.__%'
Anything more complex will likely return false negatives and run slower.
Validating e-mail addresses in code is virtually impossible.
EDIT: Related questions
- I've answered a similar question some time ago: TSQL Email Validation (without regex)
- T-SQL: checking for email format
- Regexp recognition of email address hard?
- many other Stack Overflow questions
这篇关于Sql脚本查找无效的电子邮件地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文