Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to insert unicode text to SQL Server from query window

Tags:

sql

unicode

I'm using the following code:

INSERT INTO tForeignLanguage ([Name]) VALUES ('Араб') 

this value inserted like this '????'

How do I insert unicode text from the sql management studio query window?

like image 335
ebattulga Avatar asked Aug 29 '09 09:08

ebattulga


2 Answers

The following should work, N indicates a "Unicode constant string" in MSSQL:

INSERT INTO tForeignLanguage ([Name]) VALUES (N'Араб') 
like image 148
Ian Kemp Avatar answered Sep 23 '22 05:09

Ian Kemp


The perfect solution with data type limitation:

Basically in MS-SQL Server Amharic text not working properly when the column datatype is 'text'.Therefore to put Amharic text on column with datatype text, first change the text datatype to 'nvarchar(MAX)' or just 'nvarchar' with any char length that MS-SQL Server supported.

like image 26
Sisay Nigatu Avatar answered Sep 19 '22 05:09

Sisay Nigatu