Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2005

    Unanswered: replace special character

    I'm trying to remove the special character from a varchar

    select replace(my_col,'',' ')

    this works, but the problem is that it also seems to replace the 'normal' y

    (Database is case sensitive)

    Why is that?

  2. #2
    Join Date
    Dec 2002
    I'm guessing a bit here, since I don't have that much experience outside of the default collation for SQL. I think your collation is probably Case Sensitive, Accent Insensitive (CS_AI) (see SQL Collation Name in BOL). I think what you will have to do is perform a binary comparison of your search string to ensure that you are only replacing the desired character. You will probably have to perform the comparison in the WHERE clause, since I don't see a binary option for the REPLACE function.

    Sorry, that's not much to go on; I hope it might lead you in the right direction.


    Have you hugged your backup today?

  3. #3
    Join Date
    Nov 2003
    Try this:

    select replace(my_col,char(255),'')
    Kit Lemmonds

  4. #4
    Join Date
    Jan 2005
    the char(255) has the same effect,
    but changing the collation to AS does the trick

    Thanks for the replies

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts