I want to use unicode text in my site. I have nvarchar(max) data type in database to store the data. When I save unicode text into database, it works fine. However when i try to perform some sql operation the unicode text is changed to "?????" Eg, the query below
declare @unicodetext nvarchar(250)
set @unicodetext='बन्द'
select @unicodetext
results
What is the solution for this? Thanks
SQL Server has long supported Unicode characters in the form of nchar, nvarchar, and ntext data types, which have been restricted to UTF-16.
SQL Server UNICODE() Function The UNICODE() function returns an integer value (the Unicode value), for the first character of the input expression.
UNICODE is a uniform character encoding standard. A UNICODE character uses multiple bytes to store the data in the database. This means that using UNICODE it is possible to process characters of various writing systems in one document.
Try
declare @unicodetext nvarchar(250)
set @unicodetext = N'बन्द'
select @unicodetext
Maybe you noticed that SQL Server uses N
to any quoted string input when generating DDL scripts for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With