replace unicode substring

Posted on 2005-04-16
Last Modified: 2008-02-26
I am trying to use REPLACE function in a SQL Server 2000 Script to replace some corrupted unicode data with the correct characters. I made it but the problem is case sensitiveness problem. For example "print replace(N'ÐðððÐÐ', N'ð', 'ğ')" command results like that: "ğğğğğğ", but it suppose to be like that: "ÐğğğÐÐ". Corrupted datas are 'Ð' is 0xD000 and 'ð' is 0xF000. The correct datas are 'Ğ' is 0x1E01 and 'ğ' is 0x1F01. If you know a way to use REPLACE function case sensitive or any other solution to change data, it will be helpfull. Thanks a lot.

Question by:keles
    LVL 28

    Expert Comment

    Try this:

    print replace(N'ÐðððÐÐ' COLLATE Latin1_General_CS_AS , 'ð', ğ)
    LVL 28

    Accepted Solution

    Try this:

    print replace(N'ÐðððÐÐ' COLLATE Latin1_General_CS_AS , N'ð', N'ğ')

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
    The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
    Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
    Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now