Reputation: 1455
I am trying to add this name -> NumāTwó into a table in MS sql server along with the accents. But it is only getting inserted as -> NumaTwó (without ā). I tried many encodings but doesn't seem to work. I have given the DDL of the table below. Please help
CREATE TABLE [dbo].[test](
[testname] [nvarchar](40) COLLATE SQL_Latin1_General_CP1253_CI_AI NULL
) ON [PRIMARY]
----------- Insert-----------
insert into test values ('NumāTwó');
Upvotes: 1
Views: 2330
Reputation: 3342
use N
as Prefix for Unicode character
CREATE TABLE [dbo].[test](
[testname] [nvarchar](40) COLLATE SQL_Latin1_General_CP1253_CI_AI NULL
) ON [PRIMARY]
----------- Insert-----------
insert into test values (N'NumāTwó');
Upvotes: 6
Reputation: 172448
Try to use N before the string while inserting like this:
insert into test values (N'NumāTwó');
Upvotes: 3