String check - AlphaNumeric

I need a way to check a string to see if it contains a mixture of alpha and numerics - also need to check if one is just alpha or just numeric - whichI think I can do from the below - but not certain how to check to see if contains any mixture of alpha and numerics.

-- Numeric only check?
WHEN PATINDEX('%[^0-9]%', @var) = 0

Alpha only check?
WHEN PATINDEX('%[^A-Z]%', @var) = 0
tbaseflugAsked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
alphanum only:
WHEN PATINDEX('%[^0-9A-Z]%', @var) = 0

Open in new window

0
 
tbaseflugAuthor Commented:
Perfect - thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.