sql server 2012 data column used for 7 different languages

  • In a sql server 2012 database, I want to store some messages in the database for the following languages:

    Karen, Arabic, Nepali, Burmese, and Kiswahili. This would be in a column called stringtemplate that is currently defined

    as varchar(max).

    **note: this column currently stores messages in English and Spanish.

    Can you tell me if I need to change anything about the column in the database? If so, would you show me what I need to change so that

    I can store all the language messages in the same column if possible.

  • Defining the column as NVARCHAR(MAX) would be a safer option. I'm sure that you'll need Unicode support for some of the characters in those languages.

    --Edit: you should also probably read up on collation.

    • This reply was modified 5 years, 6 months ago by  Phil Parkin.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • You need to use a Unicode data type like nvarchar -

    ALTER TABLE YourTable
    ALTER COLUMN YourColumn NVARCHAR(MAX)

     

    Sue

  • This might help:

    https://stackoverflow.com/questions/3560173/store-arabic-in-sql-database

    You have to change the collation for the various columns and use NVARCHAR() and NCHAR() because you need Unicode support.

  • pietlinden wrote:

    This might help: https://stackoverflow.com/questions/3560173/store-arabic-in-sql-database You have to change the collation for the various columns and use NVARCHAR() and NCHAR() because you need Unicode support.

     

    There's only one column and it needs to accommodate multiple languages, so I don't think that this is the solution.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • pietlinden wrote:

    This might help: https://stackoverflow.com/questions/3560173/store-arabic-in-sql-database You have to change the collation for the various columns and use NVARCHAR() and NCHAR() because you need Unicode support.

     

    Probably not - see the Unicode section in the following documentation as it states that

    there is no need for different code pages to handle different sets of characters. If you store character data that reflects multiple languages in SQL Server ( SQL Server 2005 (9.x) through SQL Server 2017), use Unicode (UTF-16) data types (nchar, nvarchar, and ntext

    Collation and Unicode Support

     

    Sue

     

  • What is better to sue ntext or nvarchar(max) and why?

  • Your answer is here.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply