Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 collation again...

Author  Topic 

nicoart
Starting Member

11 Posts

Posted - 2007-08-16 : 04:45:04
Hi,

I am just trying to understand about how collation and unicode work in SQL Server. My database's collation is Latin1_General, and I set one column in one table to have collation Cyrillic_General.
Then in Windows PC where I am running an application that is connected to my database, I set Mongolian Language from Regional Settings. When I typed using Mongolian Keyboards and save the characters into database, then I can retrieve the cyrillic characters back into my application.
However, when I checked into database using Query Analyzer, those characters are saved in the column, that has collation Cyrillic_General and with nchar data type, apparently using codepage 1252, my database default codepage. My application and my database server are located in two different machines and I don't install Mongolian language in my database server. So that when other web application reads those characters from that column, even my browser has been set to use Cyrillic encoding, still it showed as characters from codepage 1252.

Could someone explain me what actually happens here?

Thanks very much before.

Nico.A.

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-08-16 : 22:14:57
Did you insert string with leading N like N'xxxx'?
Go to Top of Page

nicoart
Starting Member

11 Posts

Posted - 2007-08-17 : 02:54:08
quote:
Originally posted by rmiao

Did you insert string with leading N like N'xxxx'?



My application actually is not developed by me. It is an ERP application developed in COBOL so I am sure it doesn't use leading N for inserting string.

I just would like to know how could this application understands that it should convert the hexadecimal values, that are represented by database, by looking at the column using Query Analyzer, as characters from character set 1252, but in the application is represented as character set 1251, which is correct. Is there anyway also so SQL Server saves the characters as character set 1251?
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-08-17 : 23:18:07
Then you need change collation for the column.
Go to Top of Page

nicoart
Starting Member

11 Posts

Posted - 2007-08-23 : 22:21:11
Thanks rmiao, I will try to change the collation.
Go to Top of Page
   

- Advertisement -