Replace() is not replacing only expected characters

  • Trying to Replace() characters:

    REPLACE(REPLACE(REPLACE(REPLACE(NetworkMemberId,'é','e'),'í','i'), 'ó','o'),'ñ','n')

    but it is converting all e's, i's, o's, and n's, even upper case.

    I tried using char(233), char(236), char(243) and char(241) with the same results.

  • What collation are you using?

  • Database default collation is SQL_Latin1_General_CP1_CI_AI

  • liamdemasi (8/27/2015)


    Database default collation is SQL_Latin1_General_CP1_CI_AI

    There is your answer. You need to cast the column to a new collation that is case sensitive and accent sensitive to achieve the changes you are looking for in the nested replace functions.

  • Thank you.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply