Sunday, March 25, 2012

Collation issue?

Hi,
I am having problems querying some czech letters (or maybe it is
inserting that fails?).
Here is the deal:
We have a web application that supports different languages. We have
stored the different messages to be displayed into a nvarchar column
with the SQL_Danish_Pref_CP1_CI_AS collation.
resource_ID
int
langID
int
data nvarchar(4000 )
Then I update the following row into the table:
update usr_data set data='DotaznXk je vyplněn!' where langid=5 and
resource_id=7
When querying the updated value I get
resource_ID langID data
7 5 DotaznXk je vyplnen!
See the missing upside-down ^ over the letter e in the last word.
I have also tested this on collation Latin1_General_CI_AS and
Czech_CI_AS with the same result.
I created a new table with a nvarchar column with the above collation
and inserted the same text, but the result was the same.
What am I missing here?
Thanks,
> Then I update the following row into the table:
> update usr_data set data='DotaznXk je vyplněn!' where langid=5 and
> resource_id=7
For a Unicode constant, prefix the literal with N:
UPDATE dbo.usr_data
SET data = N'DotaznXk je vyplněn!'
WHERE
langid = 5 AND
resource_id = 7
Note that Unicode allows all Unicode characters to be stored. The Unicode
collation affects only sorting and comparison.
Hope this helps.
Dan Guzman
SQL Server MVP
"gurbao" <audunj@.gmail.com> wrote in message
news:1181645527.452234.163220@.x35g2000prf.googlegr oups.com...
Hi,
I am having problems querying some czech letters (or maybe it is
inserting that fails?).
Here is the deal:
We have a web application that supports different languages. We have
stored the different messages to be displayed into a nvarchar column
with the SQL_Danish_Pref_CP1_CI_AS collation.
resource_ID
int
langID
int
data nvarchar(4000 )
Then I update the following row into the table:
update usr_data set data='DotaznXk je vyplněn!' where langid=5 and
resource_id=7
When querying the updated value I get
resource_ID langID data
7 5 DotaznXk je vyplnen!
See the missing upside-down ^ over the letter e in the last word.
I have also tested this on collation Latin1_General_CI_AS and
Czech_CI_AS with the same result.
I created a new table with a nvarchar column with the above collation
and inserted the same text, but the result was the same.
What am I missing here?
Thanks,
|||Thanks a lot!
That did the trick.
Only thing I wonder now, is how I could forget :-)
Regards,
On Jun 12, 1:02Xpm, "Dan Guzman" <guzma...@.nospam-
online.sbcglobal.net> wrote:
> For a Unicode constant, prefix the literal with N:
> UPDATE dbo.usr_data
> SET data = N'DotaznXk je vyplněn!'
> WHERE
> X X langid = 5 AND
> X X resource_id = 7
> Note that Unicode allows all Unicode characters to be stored. XThe Unicode
> collation affects only sorting and comparison.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "gurbao" <aud...@.gmail.com> wrote in message
> news:1181645527.452234.163220@.x35g2000prf.googlegr oups.com...
> Hi,
> I am having problems querying some czech letters (or maybe it is
> inserting that fails?).
> Here is the deal:
> We have a web application that supports different languages. We have
> stored the different messages to be displayed into a nvarchar column
> with the SQL_Danish_Pref_CP1_CI_AS collation.
> resource_ID
> int
> langID
> int
> data X X X X X X nvarchar(4000 )
> Then I update the following row into the table:
> update usr_data set data='DotaznXk je vyplněn!' where langid=5 and
> resource_id=7
> When querying the updated value I get
> resource_ID langID X X Xdata
> X X X X X 7 X X X X X 5DotaznXk je vyplnen!
> See the missing upside-down ^ over the letter e in the last word.
> I have also tested this on collation Latin1_General_CI_AS and
> Czech_CI_AS with the same result.
> I created a new table with a nvarchar column with the above collation
> and inserted the same text, but the result was the same.
> What am I missing here?
> Thanks,
|||> Only thing I wonder now, is how I could forget :-)
I'm glad I was able to help. I think you'll remember the 'N' the next time
;-)
Dan Guzman
SQL Server MVP
"gurbao" <audunj@.gmail.com> wrote in message
news:1181646750.111306.272120@.z28g2000prd.googlegr oups.com...
Thanks a lot!
That did the trick.
Only thing I wonder now, is how I could forget :-)
Regards,
On Jun 12, 1:02 pm, "Dan Guzman" <guzma...@.nospam-
online.sbcglobal.net> wrote:
> For a Unicode constant, prefix the literal with N:
> UPDATE dbo.usr_data
> SET data = N'DotaznXk je vyplněn!'
> WHERE
> langid = 5 AND
> resource_id = 7
> Note that Unicode allows all Unicode characters to be stored. The Unicode
> collation affects only sorting and comparison.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "gurbao" <aud...@.gmail.com> wrote in message
> news:1181645527.452234.163220@.x35g2000prf.googlegr oups.com...
> Hi,
> I am having problems querying some czech letters (or maybe it is
> inserting that fails?).
> Here is the deal:
> We have a web application that supports different languages. We have
> stored the different messages to be displayed into a nvarchar column
> with the SQL_Danish_Pref_CP1_CI_AS collation.
> resource_ID
> int
> langID
> int
> data nvarchar(4000 )
> Then I update the following row into the table:
> update usr_data set data='DotaznXk je vyplněn!' where langid=5 and
> resource_id=7
> When querying the updated value I get
> resource_ID langID data
> 7 5 DotaznXk je vyplnen!
> See the missing upside-down ^ over the letter e in the last word.
> I have also tested this on collation Latin1_General_CI_AS and
> Czech_CI_AS with the same result.
> I created a new table with a nvarchar column with the above collation
> and inserted the same text, but the result was the same.
> What am I missing here?
> Thanks,

No comments:

Post a Comment