Here in this article I am going to explain how we can store the multilingual (Hindi, Japanese etc.) data in SQL SERVER table.
1. Set Unicode compatible datatype (ntext, nvarchar, nchar) for table column
2. Use N (capital) as
a prefix before inserting data/text
Example :
First of all, create a table. I have created table to store
admin users name.
Create table tblAdmin (
EnglishName NVARCHAR(100),
HindiName nchar(100),
JapaneseName ntext
)
Now insert data into table.
insert into tblAdmin(EnglishName,HindiName,JapaneseName) values(N'Vijay Saklani',N'विजय सकलानी',N'ビジェイ・サクラニ')
Select * from tblAdmin
If you will insert the into table without prefix N, data will
not be useful. It will be inserted in question mark (????) form and become
garbage. Let’s check with this also:
insert into tblAdmin(EnglishName,HindiName,JapaneseName) values('Vijay Saklani','विजय सकलानी','ビジェイ・サクラニ')
No comments:
Post a Comment