Published on

February 6, 2015

Understanding Multi-Language Support in SQL Server

Have you ever wondered how to handle different languages in SQL Server? Whether you need to store data in Hindi, Tamil, Gujarati, Telugu, Kannada, or any other language, SQL Server provides support for multi-language data storage and retrieval.

In order to store Unicode data in SQL Server, you need to ensure that the column is of a Unicode data type, such as nchar, nvarchar, or ntext. Additionally, when inserting data, you must prefix the value with the letter ‘N’ to indicate that it is a Unicode string.

Let’s take a look at an example to better understand how this works:

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

In this example, we create a table called “MultiLanguage” with three columns: “i” (integer), “j” (varchar), and “k” (nvarchar). We then insert rows with values in Gujarati, Telugu, and Kannada languages. Notice that when inserting the Unicode values, we use the ‘N’ prefix.

When selecting the data from the table, SQL Server will correctly display the Unicode values in their respective languages.

It’s important to remember these basic rules when working with multi-language data in SQL Server. By following these guidelines, you can ensure that your data is stored and retrieved accurately, regardless of the language.

This blog post is just one of many in our “Back to Basics” series. If you have any specific topics you would like us to cover, please let us know. We value your feedback and want to provide you with the most interesting and informative content.

Click to rate this post!
[Total: 0 Average: 0]

Let's work together

Send us a message or book free introductory meeting with us using button below.