I have table where numbers are stored in nvarchar
data type. The data looks as follows:
Numbers
---------
200
504 040
694 380
153 272
26 296
Now I'd like to get rid of the blank space in the numbers. However, REPLACE(Numbers,' ','')
does not work as it seems the blank space is some kind of special "blank space
".
So I tried to find any special character here using the function I found on SO (link). Nothing happened, not any special character was found.
So the next step was exporting the record into .csv
file and check data's encoding using TotalCMD. The result can be seen here:
Any ideas what could go wrong and how to replace those blank spaces? I think the Unicode encoding shows the problem, but I am lacking of knowledge in this area so I also can be wrong.
Update #1 - to show you more
The table looks like this:
Category Number
-------------------
Cars 200
Cars 504 040
Cars 694 380
Cars 153 272
Cars 26 296
Bikes 50 000
Bikes 21 412
Bikes 8 541
Now I run the query:
SELECT
t.Category, REPLACE(t.Numbers,' ','')
FROM
tableMix AS t
WHERE
t.Category = 'Cars'
SELECT
t.Category, REPLACE(t.Numbers,' ','')
FROM
tableMix AS t
WHERE
t.Category = 'Bikes'
What is strange - the first query does not replace blank spaces for the Cars
category, however the second query works without any problem for number values for Bikes
category.