Following function keeps only Alphanumeric characters in string and removes all the other character from the string. This is very handy function when working with Alphanumeric String only. I have used this many times. CREATE FUNCTION dbo.UDF_ParseAlphaChars ( @string VARCHAR(8000) ) RETURNS VARCHAR(8000) AS BEGIN DECLARE @IncorrectCharLoc SMALLINT SET @IncorrectCharLoc = PATINDEX('%[^0-9A-Za-z]%', @string) WHILE @IncorrectCharLoc… Continue Reading...
Source: SQL SERVER – UDF – Function to Parse AlphaNumeric Characters from String | Journey to SQL Authority with Pinal Dave
No comments:
Post a Comment