Hi @Rupa ,
Please refer to below :
declare @table table
([column] varchar(100))
insert into @table values
('Abc'),
('123'),
('Abc123'),
('456'),
('45adb')
select [column],CASE
WHEN ISNUMERIC([column])=1 THEN 'numberic'
WHEN [column] LIKE '%[A-Z]%' and [column] not LIKE '%[0-9]%' THEN 'alpha'
WHEN [column] LIKE '%[A-Z]%' and [column] LIKE '%[0-9]%' THEN 'alphanumberic'
END AS output
from @table
Output:
column output
Abc alpha
123 numberic
Abc123 alphanumberic
456 numberic
45adb alphanumberic
Best regards,
Melissa
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.