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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Problems with cyrillic characters in ntext field

Author  Topic 

kussy
Starting Member

2 Posts

Posted - 2009-02-03 : 05:26:32
I've got a Table called CICD_CONTENT
In a ntext column called content_value one record has the cyrillic alphabet inside.
(I Copy / pasted it from wikipedia site)

I'v got no problems with insert, update and select (over id) this contents, but

When i send the query

SELECT * FROM CICD_CONTENT WHERE content_value LIKE N'%?%'
? means the AE (#1236) in this forum it can' be displayed...

It returns me ALL Records of this table !!

This problem seems occure if any unicode character in the search string is greater than #1228
Other characters, like ? (#1149) worked fine.

I don't know, what to do...

Any ideas ??

Thanks for help

Arnold Fribble
Yak-finder General

1961 Posts

Posted - 2009-02-03 : 09:10:33
I agree that this seems very strange, since other character that LIKE isn't ignoring have exactly the same Unicode properties and were added in the same version of Unicode (1.1). Other than using a binary collation (e.g. Latin1_General_BIN2) it doesn't appear to make any difference what collation is used for the comparison.
Go to Top of Page

kussy
Starting Member

2 Posts

Posted - 2009-02-04 : 01:44:15
Thanks alot Arnold

This seems to be the solution for my problem.

SELECT * FROM CICD_CONTENT WHERE content_value like N'%...%' Collate Latin1_General_BIN2


Nice day
Go to Top of Page

Arnold Fribble
Yak-finder General

1961 Posts

Posted - 2009-02-04 : 16:26:48
Just to follow up on this, I got around to checking on SQL Server 2008.
The old collations have to stay the same so that existing indexes don't go wrong, but the new _100_ collations allow LIKE to correctly see NCHAR(1236) (and many others!) as something different from an empty string.
So if you're using SQL Server 2008, collations like Latin1_General_100_CI_AS or Cyrillic_General_100_CI_AS should work fine.
Go to Top of Page
   

- Advertisement -