1

Is there any way to store āre exactly in SQL server table.

I hardcoded the same value in varchar column. It is saving are. I wanted to store along with special symbols

Perla Rupa
  • 29
  • 4
  • 1
    Have you tried with N'Value like insert into tbl (name) values (N'Parela') like this. If not solved your problem then you should post schema, sample data and desired output along with what you have tried so far. – Suraj Kumar Mar 22 '19 at 07:17
  • 2
    Possible duplicate of [Ukrainian character change to question mark when insert to table](https://stackoverflow.com/questions/46196062/ukrainian-character-change-to-question-mark-when-insert-to-table) – Ilyes Mar 22 '19 at 07:25

2 Answers2

1

Use Nvarchar - Nvarchar stores UNICODE data. If you have requirements to store UNICODE or multilingual data, Nvarchar is the choice. You need an N prefix when inserts data. Varchar stores ASCII data.

Refer below sample code

declare @data table
(field1 nvarchar(10))


insert into @data
values
(N'āre')

select * from @data
Mukesh Arora
  • 1,763
  • 2
  • 8
  • 19
0

You need to declare your string assignment using the N prefix (the N stands for "National Character") as you need to explicitly say you are passing a string containing unicode characters here (or an nchar, ntext etc if you were using those).

NVarchar variable are denoted by N' so it would be

DECLARE @objname nvarchar(255)
set @objname=N'漢字'
select @objname

Now the output will be 漢字 as it has been set. Run above code.

Suraj Kumar
  • 5,547
  • 8
  • 20
  • 42