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)
 LIKE to be NOCASE-SENSITIVE

Author  Topic 

Halil416
Starting Member

5 Posts

Posted - 2007-01-28 : 16:08:23
hi everyone,
I have a problem related with character sets and unicoding
I have a multi-language db and I am using sql to retrieve data from it.

In Turkish language UPPER case for 'i' is 'Ý', while as you know in english Upper case for 'i' -> 'I' instead..
Also UPPER case for 'ý' is 'I' in turkish.

I have thousands of turkish and english words combined in rows.
Now what I am trying to do is to build a search mechanism.

SELECT column_a LIKE %iiii%

type of search returns casesensitive result, which i would not prefer..What I want is any combinations in

iIiI
ÝiIi
iiiI
...
..
..
as a result from query as the one above...
(consider that this list can be lengthened as the number of chars
increases.)

So first question is:
1.) is there a way to allow above statement act as it is supposed to?

NOT being exact solution but being a part of it, enforcing LIKE to be
NOCASE-SENSITIVE might narrow down the number of combinations so
I would write a function to handle the rest of combinations possible
and that will handle the stuation.

2.)is it possible to make LIKE command to allow NOCASE-SENSITIVE data?

I am using DELPHI7 + PARADOX + BDEQUERY OBJECT

nr
SQLTeam MVY

12543 Posts

Posted - 2007-01-28 : 23:01:05
try
x like 'xxx' collate xxxxxxx

To get a list of available collations
select * from fn_helpcollations()

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-01-29 : 08:45:27
See also: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=Making%20Upper,Lower%20Case%20Sensitive%20comparison

Kristen
Go to Top of Page
   

- Advertisement -