The method of SQL to judge whether the string contains numbers and letters

Time:2021-6-14

Determine whether there are letters


select PATINDEX('%[A-Za-z]%', ‘ads23432')=0

(if there are letters, the result is > 1)

Determine whether there are numbers


PATINDEX('%[0-9]%', ‘234sdf')=0

(if there is a number, the result is > 1)