Filtering SQL characters using CJK punctuation characters

I have some rows in sql server 2012 database where there is CJK space (more space)

Unicode decimal: 12288

Hex: 3000

I would like to write an SQL query to filter them using the WHERE clause. Any pointers?

Thanks Rajesh

+1
source share
1 answer

You can create a Unicode character using the function NCHAR():

SELECT NCHAR(0x3000); -- http://unicode-table.com/en/3000/

WHERE , REPLACE(), . ( _BIN2), , - , ( , , , ).

SELECT * 
FROM   [Table]
WHERE  [Column] LIKE N'%' + NCHAR(0x3000) + N'%' COLLATE Latin1_General_100_BIN2;

UPDATE tbl
SET    tbl.Column = REPLACE(tbl.[Column] COLLATE Latin1_General_100_BIN2,
                            NCHAR(0x3000),
                            N' ')
FROM   [Table] tbl
WHERE  [Column] LIKE N'%' + NCHAR(0x3000) + N'%' COLLATE Latin1_General_100_BIN2;
+1

All Articles