Remove Non-Numeric Character in SQL String Expression
This T-SQL tutorial includes a user-defined SQL Server function code to clear alpha characters from an input string expression. Database programmers can use the given user-defined function in their development codes for removing characters except numbers from 0 to 9.
Here is a very basic user defined SQL function which removes unwanted alpha characters which does not represent numbers in a string expression
If database developers check the regular expression used in PatIndex SQL function, they will see that the regular expression continuously checking characters representing characters except 0 to 9.
Here to use user defined SQL Server function in a sample case for Transact-SQL developers
Here is the output of above sample SQL function
This SQL function code can be used after changing the PatIndex regular expression part to remove numeric characters in SQL string expression.