question

nandhinir avatar image
nandhinir asked

Multi language in SQL

Hi, My database contains English, Arabic and Kurdish data for master tables. User can enter the data in any one of the languages for transaction tables (either any one language only exists) . Data to be retrieved in all languages based on user language selected. Kindly suggest.
sql-server-2012languagemaster-data-management
1 comment
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

This site runs off of votes. Please mark all helpful answers by clicking on the thumbs up next to those answers. If any one answer lead to a solution, please indicate that by clicking on the check mark next to that answer.
0 Likes 0 ·
Venkataraman avatar image
Venkataraman answered
You should have Unicode support for your database. You should go for nvarchar, nchar, nvarchar(max) datatypes for text information. Refer to this post: http://social.msdn.microsoft.com/Forums/sqlserver/en-US/3b9b6c72-2123-4115-9378-ff46c3182396/how-multiple-languages-are-stored-in-database?forum=transactsql
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

nandhinir avatar image
nandhinir answered
Thanks for your reply. I am having the description fields as nvarchar only. But retrieving the data is very difficult. Please find the attached file for the query.![alt text][1] [1]: /storage/temp/1325-query2.png

query1.png (24.6 KiB)
query2.png (23.0 KiB)
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Venkataraman avatar image
Venkataraman answered
I have tried below using multi language and it is working fine. You have to have prefix N for nvarchar, nchar, nvarchar(max) Datatypes to denote national character set. CREATE TABLE languagetest ( identifier INT IDENTITY(1, 1) , langdesc NVARCHAR(30) ); INSERT INTO languagetest ( langdesc ) VALUES ( N'lengthy' ); INSERT INTO languagetest ( langdesc ) VALUES ( N'लंबा' ); SELECT * FROM languagetest where langdesc = N'लंबा';
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.