Sandeep Thomas
Sandeep Thomas

Reputation: 4727

Special Characters like ❷ ❶ ❸ are not storing correctly in SQL even when the type is nVarchar

I facing a weird issue in SQL. Im trying to save these characters ❷❶❸ into SQL. But its storing as Question Marks (?). The field is nVarchar.

This is my update query

update mytable set keywords='key1❶,key2❶,key3❶,key4❶' where id=50543

Upvotes: 1

Views: 406

Answers (1)

Roman Marusyk
Roman Marusyk

Reputation: 24579

The column should be created as

CREATE TABLE mytable (columnname NVARCHAR(40) COLLATE SQL_Latin1_General_CP1253_CI_AI)

Then when insert use prefix Unicode character string

INSERT INTO mytable (columnname) VALUES (N'❷❶❸')

Upvotes: 3

Related Questions