What collation selected for the Spanish language in sql server 2012?

10,905

Solution 1

In place of "utf8" you'd use the nvarchar/nchar types (which is actually UCS-2 in SQL Server)
This stores any character. Although, varchar/char may be OK for Spanish. I know it works for other Western European languages

Then you'd choose a collation (for sorting and comparing) like Modern_Spanish_Bin
All Spanish except one seems to use this says MSDN. The "one" is Traditional_Spanish_Bin

This is slightly different to MySQL where the charset is in the collation and everything is varchar. SQL Server separates sort/compare (collation) from storage (datatype varchar vs nvarchar)

Edit:

  • Modern_Spanish_CI_AS: ignores case so a = A but compares accents à <> a
  • Modern_Spanish_bin: looks at the bit patterns only. So a <> A

MSDN

Solution 2

Is Traditional_Spanish_ci_ai what you're looking for?

Share:
10,905
rkmax
Author by

rkmax

I'm doing web applications since 2009, designing basic concept, data models, backend, frontend and GUI. I have experience solving problems in information management. work with different programming languages like Javacript, PHP, Java, Ruby, Perl. Developing web applications with PHP/Symfony, Node.js/express Object-Oriented Programming (PHP5, C#, Java) Designing databases (MySQL) Design Macros and Script in VBA for Office 2010 (Word, Excel) Developing App for Android

Updated on September 02, 2022

Comments

  • rkmax
    rkmax over 1 year

    What collation selected for the Spanish language in sql server 2012?

    Always use utf8_bin in MySQL but in SQL Server is not a choice. the language is Latin American Spanish or any alternatives to utf8_bin?

    EDIT

    What is the difference between Modern_Spanish_CI_AS and Modern_Spanish_bin?

  • rkmax
    rkmax almost 12 years
    I do not know. I'm looking for something that has no problems with my language and special characters such as: ñ Ñ á é í ó ú Á Ó Í etc
  • rkmax
    rkmax almost 12 years
    you are referring to the data type of columns? like VARCHAR(X)
  • rkmax
    rkmax almost 12 years
    all my text fields are VARCHAR, except for some that are TEXT
  • ZygD
    ZygD almost 12 years
    @rkmax: I think varchar may work for Spanish actually. Note that text is deprecated for "varchar(max)"