Greek Query part 2

Posted on 2005-04-01
Medium Priority
Last Modified: 2011-10-03
In my table an ntext field contains mixed language data, english, german and greek.

Running a query with greek like

select engelszoektekst from lemma where engelszoektekst like N'% ***greek with diacritics here*** %'

works just fine.

If I replace characters with diacritics by basic characters (i.e. alpha for all alpha variants) i get no result. Using accent insensitive colation like

select engelszoektekst from lemma where engelszoektekst like N'% ***greek without diacritics here*** %' collate SQL_Latin1_General_Cp1253_CI_AI does not help.

Any ideas?

Question by:pietjepuk
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Author Comment

ID: 13735366
in ASP, you can use this function :

Public Function removeAccent(source)
    avantConversion = "àÀâÂäÄáÁéÉèÈêÊëËìÌîÎïÏòÒôÔöÖùÙûÛüÜçÇ’ñ"
    apresConversion = "aAaAaAaAeEeEeEeEiIiIiIoOoOoOuUuUuUcC'n"

    temp = source
    For boucle = 1 To Len(avantConversion)
        temp = Replace(temp, Mid(avantConversion, boucle, 1),
Mid(apresConversion, boucle, 1))
    temp = Replace(temp, "œ", "oe")

    removeAccent = temp
End Function

You can create this function directly in sql server like this :

CREATE FUNCTION replaceAccentChar (@source as varchar(255))
RETURNS varchar(255) AS

declare @charList as varchar(20)
declare @temp as varchar(255)
declare @t as int

set @temp = @source
set @charList = 'aeioucn'

set @t = 0
while @t <= len(@charList)
    set @temp = replace(@temp, substring(@charList, @t, 1),
substring(@charList, @t, 1))
    set @t = @t + 1
set @temp = Replace(@temp, 'œ', 'oe')
set @temp = Replace(@temp, '’', '''')

return @temp


Accepted Solution

modulo earned 0 total points
ID: 13739272
Closed, 500 points refunded.

Community Support Moderator
Experts Exchange

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question