Reputation: 71
In sql Server I join two query using UNION and my "Address" column has nText datatype so it's have an issue in Distinct. So i have to convert Address column nText to varchar but in output i got symbolic data in Adress. Actual data is in our local 'Gujarati' Language.
Upvotes: 0
Views: 61
Reputation: 107626
The n
in ntext
basically means "Unicode." In order to maintain those characters, you need to cast to another Unicode type.
The Unicode equivalent to varchar
is nvarchar
, so your query might end up looking like:
SELECT DISTINCT CONVERT(nvarchar(max), [Address])
FROM YourTable
Upvotes: 1
Reputation: 7766
varchar:
Variable-length, non-Unicode character data. The database collation determines which code page the data is stored using.
nvarchar:
Variable-length Unicode character data. Dependent on the database collation for comparisons.
so change your type varchar
to nvarchar
it will sort your issue..
Same issue face by me during storing arabic charachters
Upvotes: 2