[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3047
  • Last Modified:

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
0
tbaseflug
Asked:
tbaseflug
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
alphanum only:
WHEN PATINDEX('%[^0-9A-Z]%', @var) = 0

Open in new window

0
 
tbaseflugAuthor Commented:
Perfect - thanks!
0

Featured Post

2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

Tackle projects and never again get stuck behind a technical roadblock.
Join Now