I have a column of alphanumeric IDs let's call it [IDS].
The id's are meant to be numbers only, but some of them have stray characters.
For example:
[IDS]
- 012345A
- 23456789AF
- 789789
I want to turn these into numbers only - so the output would be:
[IDS]
012345
23456789
789789
I want to write some code that will search the column for all and any letters in the alphabet (A-Z) and remove them so I can extract the numeric value.
I know I could do a replace(replace(replace(....etc but for all 26 letters in the alphabet this isn't ideal.
I am now trying to solve it using a "declare @" but these seem to be designed for specific strings and I want the whole column to be searched and replaced.
Using Microsoft SQL Server.
Thanks