Home » CodeProject » Multilanguage Table, How to insert different language text in table ?

Multilanguage Table, How to insert different language text in table ?


Issue :

Today, I received one request from my old friend.

He wants to insert text in different languages in table. He is looking to create Multilanguage table.

Solution :

The simplest solution is to insert data in table as NVARCHAR data type, like below.

–Create Table

CREATE TABLE TBL_LANG

(

LNAME VARCHAR(50),

LTXT NVARCHAR(100)

)

–Insert “Hello World” in diffrent language

INSERT INTO TBL_LANG

VALUES (‘English’,N’Hello World’)

INSERT INTO TBL_LANG

VALUES (‘Hindi’,N’हैलो दुनिया’)

INSERT INTO TBL_LANG

VALUES (‘Chines’,N’你好世界’)

INSERT INTO TBL_LANG

VALUES (‘Urdu’,N’ہیلو دنیا’)

–View Table data

SELECT * FROM TBL_LANG

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: