unknown character

  • I'm extracting from a DB2 table and loading into SQL2005. I've got this weird character that appears to be double-quotes. When looking at it closer it's 2 dots.... Has anyone seen anything like this before? I need to perform a REPLACE function to remove the characters but nothing has worked so far.

    YAHOO¨ TRAVEL

  • It looks to be ASCII code 168. Run your REPLACE code with CHAR(168) as what you're looking for.

    As in - (using a square bracket as the replacement)

    select replace('YAHOO¨ TRAVEL',char(168),']')

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • That did it. Thanks Matt.. 5 stars.

    I finally found a table of characters.. if anyone is interested.

    http://www.dropbears.com/u/utilities/character.htm

  • Another point for experience to work with these problems!

    ============================================================
    SELECT YOUR PROBLEM FROM SSC.com WHERE PROBLEM DESCRIPTION =
    http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]

  • Rich96 (10/4/2008)


    That did it. Thanks Matt.. 5 stars.

    I finally found a table of characters.. if anyone is interested.

    http://www.dropbears.com/u/utilities/character.htm

    Cool. Thanks for the feedback.

    If you ever need to make one yourself, you can do it several ways quite easily... here's two...

    If you have a Tally or Numbers table... (see http://www.sqlservercentral.com/articles/TSQL/62867/ for more info)

    SELECT N AS DecimalValue, CAST(N AS BINARY(1)) AS HexValue, CHAR(N) AS AsciiCharacter

    FROM dbo.Tally WITH (NOLOCK)

    WHERE N BETWEEN 32 AND 255

    ORDER BY N

    ... and if you don't, you can use the small built in one...

    SELECT Number AS DecimalValue, CAST(Number AS BINARY(1)) AS HexValue, CHAR(Number) AS AsciiCharacter

    FROM Master.dbo.spt_Values WITH (NOLOCK)

    WHERE Type = 'P'

    AND Number BETWEEN 32 AND 255

    ORDER BY Number

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • O man o man,

    once again the Tally table Maestro is here ...Jeff thnx for your professional feedback here with you amazing table "TALLY"

    ============================================================
    SELECT YOUR PROBLEM FROM SSC.com WHERE PROBLEM DESCRIPTION =
    http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]

  • Heh. Thanks, Dugi... I appreciate the feedback. 🙂

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Rich96 (10/4/2008)


    That did it. Thanks Matt.. 5 stars.

    I finally found a table of characters.. if anyone is interested.

    http://www.dropbears.com/u/utilities/character.htm

    Glad that did the trick! thanks for the feedback

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

Viewing 8 posts - 1 through 7 (of 7 total)

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