Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server 2008 search double byte characters

Is there a way to tell which records are double byte character in SQL Server 2008?

For example, I want to query all records in Chinese, Korean and Japanese in a table if country filed is blank, how can I do it?

Your input is really appreciated.

I think I might have confused you guys. Everything is stored in nvarchar. Some records are in Chinese, some are in Korean, Some are in Spanish and more. We want to find out the Chinese, Japanese and Korean records to do something about it. Does that make sense?

like image 455
Percy Avatar asked Feb 28 '11 18:02

Percy


People also ask

How do you identify a double-byte character?

Shift Out and Shift In characters are required to identify the double-byte data in a mixed character string. DBCLOB - A double-byte character large object. The maximum length of a DBCLOB is 1,073,741,823 DBCS characters.

What is char () in SQL Server?

SQL Server CHAR() Function The CHAR() function returns the character based on the ASCII code.


1 Answers

Is there a way to tell which records are double byte character in SQL Server 2008?

You can use this - if the double-byte character cannot be reduced to a single byte, then you have CJK in the record:

select * from tbl
where convert(nvarchar(max),convert(varchar(max),somecolumn)) != somecolumn
like image 109
RichardTheKiwi Avatar answered Oct 14 '22 02:10

RichardTheKiwi