查看SQL数据库中是否含有全角字符

检索出含有全角数字的记录:

SELECT * FROM RSItem WHERE itemcode COLLATE Chinese_PRC_CS_AS_WS like '%[0-9]%'

或者是:

SELECT * FROM RSItem WHERE itemcode COLLATE Chinese_PRC_CS_AS_WS like '%0%'
SELECT * FROM RSItem WHERE itemcode COLLATE Chinese_PRC_CS_AS_WS like '%1%'
SELECT * FROM RSItem WHERE itemcode COLLATE Chinese_PRC_CS_AS_WS like '%2%'
SELECT * FROM RSItem WHERE itemcode COLLATE Chinese_PRC_CS_AS_WS like '%3%'
SELECT * FROM RSItem WHERE itemcode COLLATE Chinese_PRC_CS_AS_WS like '%4%'
SELECT * FROM RSItem WHERE itemcode COLLATE Chinese_PRC_CS_AS_WS like '%5%'
SELECT * FROM RSItem WHERE itemcode COLLATE Chinese_PRC_CS_AS_WS like '%6%'
SELECT * FROM RSItem WHERE itemcode COLLATE Chinese_PRC_CS_AS_WS like '%7%'
SELECT * FROM RSItem WHERE itemcode COLLATE Chinese_PRC_CS_AS_WS like '%8%'
SELECT * FROM RSItem WHERE itemcode COLLATE Chinese_PRC_CS_AS_WS like '%9%'

查看含有字母的记录也类似:

SELECT * FROM RSItem WHERE itemcode COLLATE Chinese_PRC_CS_AS_WS like '%A%'

你可能感兴趣的:(SQL,Server)