-- 获取第一个大写字母的位置
select patindex('%[A-Z]%',product_name) from table
-- 获取第一个非大写字母的位置
select patindex('%[^A-Z]%',product_name) from table
-- 获取第一个非空字符的位置(里面有个空格)
select patindex('%[^ ]%',product_name) from table
-- 获取第一个中文的位置
select patindex('%[吖-座]%',product_name) from table
-- 获取第一个小写字母的位置
select patindex('%[a-z]%',product_name) from table
-- 获取第一个数字的位置
select patindex('%[0-9]%',product_name) from table
mssql获取首个中文/非中文字符的位置patindex
于 2022-01-30 16:21:36 首次发布