This is a mirror of official site: http://jasper-net.blogspot.com/

TSQL Beginners Challenge 10 - Clean up alphanumeric strings by splitting digits and letters into separate columns

| Tuesday, June 22, 2010
This challenge refers to sanitizing text data. Your task is to read an alphanumeric string and create two output columns one containing all the digits found in the input string and the other with all the letters of the English Alphabet.

Sample Input Data
Id AlphanumericData
-- ---------------------------------------------------------------------
1 I would like to invite my readers to participate in a TSQL Challenge.
2 You will receive 12 records
3 1234567

Expected Result
Id AlphanumericData   Numbers    Alphabets
-- --------------------------  ---------  ------------------------------
1  I would like to invite my   No Number  Iwouldliketoinvitemyreaders
  readers to participate in   Found      toparticipateinaTSQLChallenge  
  a TSQL Challenge.        
2  You will receive 12 records 12         Youwillreceiverecords
3  1234567                     1234567    No Alphabets Found

Read more: Beyond Relational

Posted via email from .NET Info

0 comments: