SQL SERVER – Storing Data in Hindi, Chinese, Gujarati and Tamil (or any other) Language in the Same Table

Long time ago, I have written a blog which talks about multi language support available with SQL Server.

SQL SERVER – 2005 – Multiple Language Support

I have been getting below questions on regular basics and it still baffles me:

  1. How do I pass Hindi parameters in SQL Server procedure as I want to insert a row with Hindi text?
  2. What is the collation I need to use if I have to store Tamil in SQL Server tables?
  3. I am inserting the data in Gujarati but while selecting I am getting “???”

Here are some basic rules which you may want to keep in mind. While storing Unicode data, the column must be of Unicode data type (nchar, nvarchar, ntext). Another rule is that the value must be prefixed with N while insertion.

If you are using a stored procedure then while passing the parameter to stored procedure make sure that N is used before the string. Also make sure the parameter declared within the stored procedure which are used for carrying those variable are also defined as Unicode.

Here is the sample script and the output which can make sure understand the things. I have used Google translate to do translation and I am not sure how accurate it is in Kannada, Tamil and Telugu.

use master
If db_id('SQLAuthority') is not null
drop database SQLAuthority
set nocount on
Create database SQLAuthority
use SQLAuthority
Create Table MultiLanguage_Will_Not_Work (i int, j varchar(10), k varchar(100))
-- Hindi
Insert into MultiLanguage_Will_Not_Work values (1, 'with N', N'मेरा नाम Pinal है')
-- Tamil
Insert into MultiLanguage_Will_Not_Work values (2, 'without N', 'என் பெயர் PINAL ஆகிறது')
Select * from MultiLanguage_Will_Not_Work
Create Table MultiLanguage (i int,j varchar(10), k nvarchar(100))
-- Gujarati
Insert into MultiLanguage values (1, 'with N', N'મારું નામ પિનલ છે')
-- Telugu
Insert into MultiLanguage values (2, 'without N', 'నా పేరు PINAL ఉంది')
-- Kannada
Insert into MultiLanguage values (3, 'with N', N'ನನ್ನ ಹೆಸರು ಪಿನಾಲ್ ಆಗಿದೆ')
Select * from MultiLanguage
use master
drop database SQLAuthority

Here is the output

SQL SERVER - Storing Data in Hindi, Chinese, Gujarati and Tamil (or any other) Language in the Same Table unicode-01

Same would work for any language as well. It is important for us to know the basics and this blog post is one of many basics blogs that I plan to write. Do let me know which topic you would like me to revisit as part of this – back to basics series? More ideas you give me, more interesting the series can be.

Reference: Pinal Dave (https://blog.sqlauthority.com)

SQL Collation
Previous Post
SQL SERVER – Configure, Monitor and Restore Backups from Mobile & Web browser
Next Post
Hey DBA – Protecting a Proactive Attitude – Notes from the Field #069

Related Posts

41 Comments. Leave new

  • Hi Pinal,

    I regularly visit your blogs. I found many important things many times. Is there a way to create language converter function in sql server?
    example :
    select dbo.spanish(‘english’)

  • Thx alot sir

  • Hi

    Not working Tamil font in your insert Query
    can you update?

    • You should use like this

      Insert into MultiLanguage_Will_Not_Work values (2, ‘without N’, N’என் பெயர் PINAL ஆகிறது’)-

  • Good one…sir

  • Dhruvi Patel
    June 9, 2020 5:06 pm

    can you help me to find chinese characters data from table.?

  • Vinayak Joshi
    July 26, 2020 2:49 pm

    Hello Pinal,

    below ismy query. i want heading in gujarati. can you please help me.

    declare @Query1 varchar(max)
    SET @Query1 =’
    select ReferenceNo as ‘N’આવક સંદર્ભ”
    from GovernmentReferenceDashboard where 1=1’
    print (@Query1)
    exec (@Query1)


  • I want to search a table and retrieve the records where there’s hindi content how do I do that ?


Leave a Reply