Questions tagged [collation]

Collation refers to a set of rules that determine how data is sorted and compared. Character data is sorted using rules that define the correct character sequence, with options for specifying case-sensitivity, accent marks, kana character types and character width.

Collation refers to a set of rules that determine how data is sorted and compared. Character data is sorted using rules that define the correct character sequence, with options for specifying case-sensitivity, accent marks, kana character types and character width.

Collation is often language, locale, and usage-dependent. Rules can change depending on the language being encoded (e.g., English vs. French), the region of the world (e.g., Canadian French vs. Standard French), and the purpose of the collation (e.g., a dictionary vs. a phone book). Further customisations like case-insensitive sorting are also possible.

Resources

1834 questions
53
votes
9 answers

store arabic in SQL database

I tried to store Arabic string in SQL 2008 database but it converted to " question mark " why ? and what should I do ?
kartal
  • 17,436
  • 34
  • 100
  • 145
49
votes
3 answers

In MySQL, which collation should I choose?

When I create a new MySQL database through phpMyAdmin, I have the option to choose the collation (e.g.-default, armscii8, ascii, ... and UTF-8). The one I know is UTF-8, since I always see this in HTML source code. But what is the default collation?…
bbtang
  • 5,665
  • 8
  • 33
  • 27
48
votes
3 answers

utf8_bin vs. utf_unicode_ci

My table Website Website_Name//column name Google Facebook Twitter Orkut Frype Skype Yahoo Wikipedia I i use utf8_bin collation then my query to search wikipedia in Website is Select Website_Name from Website where…
user1432124
44
votes
2 answers

Changing SQL Server collation to case insensitive from case sensitive?

I've recently installed SQL Server 2008 and I selected collation as case sensitive. I want to make it case insensitive for the entire instance (not for a database in that instance). If I change the collation does it affect any existing databases? if…
JPReddy
  • 63,233
  • 16
  • 64
  • 93
44
votes
6 answers

How to change all the tables in my database to UTF8 character set?

My database is not in UTF8, and I'd like to convert all the tables to UTF8, how can I do this?
nubela
  • 1
  • 24
  • 75
  • 123
42
votes
1 answer

UTF8 Postgresql Create Database Like MySQL (including character set, encoding, and lc_type)

For the following MySQL create database statement, what would be the equivalent in postgresql?: CREATE DATABASE IF NOT EXISTS `scratch` DEFAULT CHARACTER SET = utf8 DEFAULT COLLATE = utf8_unicode_ci; I currently have: CREATE DATABASE…
Wil Moore III
  • 6,968
  • 3
  • 36
  • 49
42
votes
10 answers

how to change the collate to all the columns of the database?

I would like to change the collation of all the columns of all the tables of my database. In stack overflow, I have found this script: (post) SELECT 'ALTER TABLE [' + SYSOBJECTS.Name + '] ALTER COLUMN [' + SYSCOLUMNS.Name + '] ' + SYSTYPES.name + …
Álvaro García
  • 18,114
  • 30
  • 102
  • 193
37
votes
4 answers

Cast collation of nvarchar variables in t-sql

I need to change the collation of an nvarchar variable. By documentation: (...) 3. The COLLATE clause can be specified at several levels. These include the following: Casting the collation of an expression. You can use the COLLATE …
35
votes
5 answers

MySQL treats ÅÄÖ as AAO?

These two querys gives me the exact same result: select * from topics where name='Harligt'; select * from topics where name='Härligt'; How is this possible? Seems like mysql translates åäö to aao when it searches. Is there some way to turn this…
Martin
  • 5,197
  • 11
  • 45
  • 60
35
votes
7 answers

Humanized or natural number sorting of mixed word-and-number strings

Following up on this question by Sivaram Chintalapudi, I'm interested in whether it's practical in PostgreSQL to do natural - or "humanized" - sorting " of strings that contain a mixture of multi-digit numbers and words/letters. There is no fixed…
Craig Ringer
  • 307,061
  • 76
  • 688
  • 778
34
votes
4 answers

Temp Table collation conflict - Error : Cannot resolve the collation conflict between Latin1* and SQL_Latin1*

I can't update temp table. This is my query CREATE TABLE #temp_po(IndentID INT, OIndentDetailID INT, OD1 VARCHAR(50), OD2 VARCHAR(50), OD3 VARCHAR(50), ORD VARCHAR(50), NIndentDetailID INT, ND1 VARCHAR(50), ND2 VARCHAR(50), ND3…
thevan
  • 10,052
  • 53
  • 137
  • 202
33
votes
5 answers

Can SQL Server SQL_Latin1_General_CP1_CI_AS be safely converted to Latin1_General_CI_AS?

We have a legacy database with some (older) columns using "SQL_Latin1_General_CP1_CI_AS" and more recent changes have used "Latin1_General_CI_AS". This is a pain as joins need the additional COLLATE statement to work. I'd like to bring everything up…
Kram
  • 4,099
  • 4
  • 39
  • 60
30
votes
5 answers

What is the best MySQL collation for German language

I am building a web site in German language, So I will be using characters like ä, ü, ß etc., So what are your recommendations?
TooCooL
  • 20,356
  • 6
  • 30
  • 49
30
votes
5 answers

Unix sort treatment of underscore character

I have two linux machines, on which unix sort seems to behave differently. I believe I've narrowed it down to the treatment of the underscore character. If I run sort tmp, where tmp contains the following two lines: aa_d_hh aa_dh_ey one machine…
user145245
27
votes
1 answer

MySQL collation: utf8mb4_unicode_ci vs "utf8mb4 - default collation"

Please help me to understand the differences between the collations listed in MySQL Workbench: utf8mb4_unicode_ci vs utf8mb4 - default collation p.s. Everyone is recommending using utf8mb4_unicode_ci. If this is so popular why it is not default?…
Yevgeniy Afanasyev
  • 37,872
  • 26
  • 173
  • 191