September 26, 2011 at 5:09 pm
We download to a system that supports limited ascii (US) character set. I've added some translations to convert
extended ascii codes like À to A. However, I find some of the translations are not working. For example
why does this result in Y
select REPLACE(CHAR(228),CHAR(196),'Y')
thanks,
jon
September 26, 2011 at 5:49 pm
Likely this is caused by your default collation being case-insensitive.
Try adding a collation statement to your script.
e.g. REPLACE(CHAR(228) COLLATE Latin1_General_BIN, CHAR(196), 'Y')
September 26, 2011 at 6:15 pm
Wow, that's really interesting. Thanks.
Is the collation setting by user or server based?
and then, if I wanted to make sure all of those funny ascci codes -
¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ®
were replaced with a space, would I be able to use the same Latin1_General_BIN
code page?
thanks again, I never would have figured this out.
September 26, 2011 at 8:07 pm
jonathan.silver (9/26/2011)
Wow, that's really interesting. Thanks.Is the collation setting by user or server based?
and then, if I wanted to make sure all of those funny ascci codes -
¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ®
were replaced with a space, would I be able to use the same Latin1_General_BIN
code page?
thanks again, I never would have figured this out.
There's a default at the server level that can be overridden at the database level which may be overriden at the column level when creating a table or view or in an SQL Statement. I'm not sure that you can set COLLATION by user... I don't believe so but I've never done any research in that particular area.
Yes... Latin1_General_Bin will help you replace "funny" ASCII code characters.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy