October 3, 2008 at 5:59 pm
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
October 3, 2008 at 6:24 pm
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?
October 4, 2008 at 11:43 am
That did it. Thanks Matt.. 5 stars.
I finally found a table of characters.. if anyone is interested.
October 4, 2008 at 4:18 pm
October 4, 2008 at 5:33 pm
Rich96 (10/4/2008)
That did it. Thanks Matt.. 5 stars.I finally found a table of characters.. if anyone is interested.
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
Change is inevitable... Change for the better is not.
October 4, 2008 at 5:52 pm
O man o man,
once again the Tally table Maestro is here ...Jeff thnx for your professional feedback here with you amazing table "TALLY"
October 4, 2008 at 6:30 pm
Heh. Thanks, Dugi... I appreciate the feedback. 🙂
--Jeff Moden
Change is inevitable... Change for the better is not.
October 4, 2008 at 6:52 pm
Rich96 (10/4/2008)
That did it. Thanks Matt.. 5 stars.I finally found a table of characters.. if anyone is interested.
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