Solved

String check - AlphaNumeric

Posted on 2008-10-03
2
2,988 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
2 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now