Learn how to a build a cloud-first strategyRegister Now


replace unicode substring

Posted on 2005-04-16
Medium Priority
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
  • 2
LVL 28

Expert Comment

ID: 13798468
Try this:

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

Accepted Solution

rafrancisco earned 1000 total points
ID: 13798472
Try this:

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

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Suggested Courses

810 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