Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UTF-8 character gets changed in INSERT statement on MS-SQL-Server

I have a table on my MS-SQL-Server 2008R2 that itself has an nvarchar(50) field.

Now when i insert a value using the Server Management Studio like

INSERT INTO INFORMATIONS(SOME_TEXT) VALUES('finančné služby')

and i immediately select the value

SELECT SOME_TEXT FROM INFORMATIONS

i get

financné služby

So the čdoes get converted into a plain c while the ž is handled just fine.

What am I missing here?

The collation is set to Latin1_General_CI_AS if that is of any help.

like image 703
BigBlackDog Avatar asked Feb 12 '14 11:02

BigBlackDog


1 Answers

Prefix your values with N while inserting.

INSERT INTO INFORMATIONS(SOME_TEXT) VALUES(N'finančné služby')

CHECK SQL FIDDLE DEMO

like image 77
Mudassir Hasan Avatar answered Nov 06 '22 09:11

Mudassir Hasan