• Jeff Moden (2/5/2010)


    Ramesh Saive (2/5/2010)


    I don't think so there is any equivalent function in SQL Server. But you can create you own function using the existing REPLACE function.

    Heh.. Let's see some code. 😉 I believe you'll find it's a wee bit more difficult to do than just using REPLACE.

    Ah..., Here is the code

    DECLARE @Characters TABLE( SomeChar CHAR(1) NOT NULL )

    DECLARE @SomeText VARCHAR(100)

    SELECT@SomeText = 'Ticking away the moments that make up a dull day, Fritter and waste the hours in an offhand way.'

    INSERT@Characters( SomeChar )

    SELECT't' UNION ALL

    SELECT'i' UNION ALL

    SELECT'c'

    SELECT@SomeText = REPLACE( @SomeText, SomeChar, '' )

    FROM@Characters

    PRINT @SomeText

    --Ramesh