I needed to remove all the special characters from a field in a particular table in SQL Server to be used for searching purposes. After searching (binging :P)… I found the next SQL Server Function which did the trick.
This Function Removes any special character from the string value passed. All characters except 0-9, a-z and A-Z are all removed, whilst the remaining characters are returned back.
ALTER FUNCTION dbo.RemoveSpecialCharacters
RETURNS VARCHAR(256) WITH SCHEMABINDING
IF (@s is null)
RETURN null Read the rest of this entry »