SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 wierd chars ?????????
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mike13
Posting Yak Master

Netherlands
214 Posts

Posted - 06/19/2013 :  14:54:51  Show Profile  Click to see mike13's MSN Messenger address  Reply with Quote
Hi All,

I got a nvarchar field that has these wierd chars in them
?????????
Ho can i just do a simple update replace.

Tried this, but didn-t work

UPDATE T_textblocks
SET textblock=Replace(textblock,'?','')

tnx a lot

mike13
Posting Yak Master

Netherlands
214 Posts

Posted - 06/19/2013 :  15:05:45  Show Profile  Click to see mike13's MSN Messenger address  Reply with Quote


seems pasting into the forum it lost its form.
it looks like this

Go to Top of Page

James K
Flowing Fount of Yak Knowledge

3712 Posts

Posted - 06/19/2013 :  17:11:30  Show Profile  Reply with Quote
If it happens to be a single funny character (or a few), you can find what those are and then replace like this:
DECLARE @x VARCHAR(32) = 'abc'+CHAR(222) + 'efg';
SELECT @x,LEN(@x), CAST(@x AS VARBINARY);

SET @x = REPLACE(@x,CHAR(0xDE),'');

SELECT @x,LEN(@x), CAST(@x AS VARBINARY);
But if the characters that you want to remove are all over the place, and you know what you want to retain, you will need to write a while loop - there is an example here: http://sqljourney.wordpress.com/2010/07/13/sql-server-remove-nonalphanumeric-special-characters-column/
Go to Top of Page

Lamprey
Flowing Fount of Yak Knowledge

4614 Posts

Posted - 06/19/2013 :  18:13:17  Show Profile  Reply with Quote
The column, more than likely, doesn't have ?????? in them. The way SSMS displays the value from that column dispalys as ?????? due to the font not being able to display those characters. Try changing the SSMS font to a good unicode font.
Go to Top of Page

mike13
Posting Yak Master

Netherlands
214 Posts

Posted - 06/21/2013 :  04:54:03  Show Profile  Click to see mike13's MSN Messenger address  Reply with Quote
Hi Tried it but didn't work.
look:


Also tried the loop from the site you gave me, didn't work also

also has nothing todo wit the ssms, because it show it also in the html pages etc

anyone, has a clue how to fix this?


Edited by - mike13 on 06/21/2013 17:12:41
Go to Top of Page

James K
Flowing Fount of Yak Knowledge

3712 Posts

Posted - 06/21/2013 :  08:31:03  Show Profile  Reply with Quote
Post the text for a sample string (similar to what you did in the image you posted on 06/19/2013 : 15:05:45), and also post the varbinary for that same string using
SELECT CAST(YourString AS VARBINARY)
Make it a short string which demonstrates the problem.

Image in your posting of 06/21/2013 : 04:54:03 is not visible.
Go to Top of Page

mike13
Posting Yak Master

Netherlands
214 Posts

Posted - 06/21/2013 :  17:18:13  Show Profile  Click to see mike13's MSN Messenger address  Reply with Quote
Hi James,

I fixed the image.

And here is the result of the query
Go to Top of Page

Lamprey
Flowing Fount of Yak Knowledge

4614 Posts

Posted - 06/21/2013 :  17:36:55  Show Profile  Reply with Quote
*facepalm* Char(63) is a questionmark.
Go to Top of Page

Lamprey
Flowing Fount of Yak Knowledge

4614 Posts

Posted - 06/21/2013 :  17:59:31  Show Profile  Reply with Quote
I'm not sure of your actual issue, but the character you are trying to represent is 65533 in unicode:

SELECT NCHAR(65533)

select unicode(NCHAR(65533)),Unicode(N'?')

RESULTS
----------- -----------
65533       63

Edited by - Lamprey on 06/21/2013 18:00:13
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000