weird character in the data

  • Hello,

     

    I have a weird character in my data and I am wondering what that character is and how can I eliminate that character.

    123456 

    When I copy and paste the above value from the enterprise manager its having two spaces after 123456 and my cursor goes to the next line.

    So whn I hit backspace button 3 times i am getting the correct string.  when I checked the length of the string it shows me 8.

     

    So how can eliminate those two weird characters at the end of the string.I have this problem for all the values in that column.

     

    Thanks.

  • Does this help?

    DECLARE @s AS VARCHAR(10)

    SET @s ' 123456 ' CHAR(13) + CHAR(10)

    PRINT @s 'line fed'

    SET @s REPLACE(REPLACE(@sCHAR(13), ''), CHAR(10), '')

    PRINT @s 'line UNfed'

  • It worked like a dream.

     

    Thanks for saving my day.

     

  • Happy to help .

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

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