I have some rows in my SQL table that contain single byte space characters, and some that contain double byte space characters. I need to identify rows with double byte characters to fix them in the user interface.
My first thought is to use charindex
and substring
to isolate the space from the rest of the text (SUBSTRING(@SomeField, charindex(' ', @SomeField),1))
and then use DataLength
to see if it was double byte or single byte, but it appears that's not going to work. It appears it's giving the same value for both single-byte and double-byte spaces.
SELECT DATALENGTH(' ') --double byte space
, DATALENGTH(' ') --single byte space
, LEN(' ') --double byte space
, LEN(' ') --single byte space