Quick technique to retrieve alphanumeric values by using regular expression in TSQL
If you have a column in a database which contains numeric, alphanumeric and only aplha values and you just want to find all those rows which have alphanumeric values i.e which contains atleast one numeric alongwith anynumber of alphabets then you can use the power of Like operator and a little regular expression technique. Following is a query for Name column in Production.Product table ofAdventureWorks database. This query retrieves all rows which contains alphanumeric values:
Use AdventureWorks
Go
Select * from Production.Product Where Name like ‘%[0-9]%’
Go




