Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

String check - AlphaNumeric

Posted on 2008-10-03
2
Medium Priority
?
3,033 Views
Last Modified: 2012-05-05
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
Comment
Question by:tbaseflug
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 22634518
alphanum only:
WHEN PATINDEX('%[^0-9A-Z]%', @var) = 0

Open in new window

0
 

Author Closing Comment

by:tbaseflug
ID: 31502777
Perfect - thanks!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question