This article is half-done without your Comment! *** Please share your thoughts via Comment ***
In this post, I am sharing a demonstration on how we can insert symbols or multilingual data in the Table of SQL Server.
One of our team members entered data into different languages data like Gujarati, Panjabi and tried to insert in VARCHAR column.
But unfortunately, he found some ‘???? ??’ characters in that column.
Sharing a small sample:
1 2 3 4 5 6 7 8 9 10 11 |
CREATE TABLE tbl_TestLanguage ( DiffLanguages VARCHAR(250) ) GO INSERT INTO tbl_TestLanguage VALUES( 'My Name') INSERT INTO tbl_TestLanguage VALUES( 'મારું નામ') INSERT INTO tbl_TestLanguage VALUES( 'ਮੇਰਾ ਨਾਮ') INSERT INTO tbl_TestLanguage VALUES( 'আমার নাম') GO |
The Result:
The Solution is NVARCHAR column:
First, you convert VARCHAR your column to NVARCHAR column and put N’ before any special text.
1 2 3 4 5 6 7 8 |
ALTER TABLE tbl_TestLanguage ALTER COLUMN DiffLanguages NVARCHAR(250) GO INSERT INTO tbl_TestLanguage VALUES( N'My Name') INSERT INTO tbl_TestLanguage VALUES( N'મારું નામ') INSERT INTO tbl_TestLanguage VALUES( N'ਮੇਰਾ ਨਾਮ') INSERT INTO tbl_TestLanguage VALUES( N'আমার নাম') GO |
The Final Result:
You can find now, multilingual data is stored in that column.