Ok, I have fixed the code in the original post to avoid anyone else using it by mistake.
The new version uses a nested REPLACE:
GO
CREATE FUNCTION dbo.IF_CleanWithReplace
(
@SomeText VARCHAR(100)
)
RETURNS TABLE
WITH SCHEMABINDING
AS RETURN
SELECT cleaned =
REPLACE(
REPLACE(
REPLACE(
@SomeText COLLATE SQL_LATIN1_GENERAL_CP1_CI_AS,
'A', SPACE(0)),
'E', SPACE(0)),
'-', SPACE(0));
GO
Thanks again, Carl.
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi