日期:2014-05-17  浏览次数:20599 次

求教一个问题:SQL server可以检测中英文吗?
求教一个问题:SQL server可以检测中英文吗?
就是判断某列是否为中文或者英文的方法。。

------解决方案--------------------
探讨

引用:

SQL code
select * from tb where charindex('[a-z]',col)>0


select * from tb where charindex('[吖-坐]',col)>0


你测试过可行吗?

------解决方案--------------------
select *,'Eng' from tb where patindex('%[a-z]%',col)>0 and (patindex('%[吖-坐]%',col)=0)
union all
select *,'CN' from tb where patindex('%[吖-坐]%',col)>0 and patindex('%[a-z]%',col)=0
union all 
select *,'Eng&CN' from tb where (patindex('%[吖-坐]%',col)>0) and patindex('%[a-z]%',col)>0

将中英文都包含的字段单独拿出来了。