Questions tagged [collation]

A collation is a set of rules that determine how data is sorted and compared for comparing characters in a character set.

Filter by
Sorted by
Tagged with
1
vote
1answer
20 views

What is the impact of converting latin1/latin1_swedish_ci to utf8mb4/utf8mb4_unicode_ci?

I was facing some issues with the character's encoding. Those are resolved by updating the CHARACTER and COLLATE for some columns in the table. So my concern is if this conversion is safe? Or does ...
1
vote
1answer
28 views

MySQL dump to MariaDB issue with collation

I have a django app running on a staging server (windows server 2012) with a MariaDB database. I have a git hook running mysqldump locally when I push to the staging branch. On the server I have a ...
0
votes
1answer
42 views

What does this statement mean: SELECT … COLLATE SQL_Latin1_General_CP1_CI_AS AS [-‌- Logins To Be Created --]

What does this statement mean? SELECT ... COLLATE SQL_Latin1_General_CP1_CI_AS AS [-- Logins To Be Created --] It is part of a script I'm trying to adapt for listing out the SQL Server logins in an ...
0
votes
1answer
496 views

MySQL- Performance implications of changing a column collation from latin1_swedish_ci to latin1_bin

I am a developer so was hoping someone with DBA experience could help me out here. I am using a MySQL database (MYSQL 5.6). I came across a situation where a particular column stores Ids generated ...
4
votes
1answer
164 views

What is difference between Arabic_100_CS_AS_KS_WS_SC_UTF8 and Latin1_General_100_CS_AS_KS_WS_SC_UTF8?

Starting from SQL Server 2019, it supports UTF-8 as collation. However, according to the following queries: SELECT COLLATIONPROPERTY('Arabic_100_CS_AS_KS_WS_SC_UTF8', 'CodePage') SELECT ...
7
votes
2answers
27k views

Storing Japanese characters in a table

I am using SQL Server 2008 R2 and I want to store Japanese characters in one of the columns of my table. Say I want to store Japanese names, how can I achieve that? Is there an easy way?
3
votes
2answers
280 views

Best General Purpose Character Set and Collation for MySQL

Currently, whenever I create a new MySQL database, I use utf8mb4 as a character set and utf8mb4_unicode_520_ci for the collation, e.g.: CREATE DATABASE IF NOT EXISTS db_name DEFAULT CHARACTER SET ...
1
vote
2answers
4k views

mysqldump collation issues

I have tried my hand at building a shell script to backup our wordpress database using tar balls and chron jobs on a Debian environment. The problem I am facing now is that our wp database after ...
1
vote
1answer
241 views

Cannot resolve the collation conflict between “Latin1_General_CI_AS” and “SQL_Latin1_General_CP1_CI_AS” in the equal to operation

Need urgent help on this. We have applied latest sql patches on one of the server (SQL 2014, SP3, CU4) and somehow we were not able to start the SQL due to following error. Cannot resolve the ...
0
votes
1answer
99 views

Storing emojis in MySQL

I'm new to MySQL database. I want to store emojis in my database. I already have data in my database, and I don't want to lose it. I don't know the proper way of storing the utf8mb4 character-set ...
0
votes
1answer
154 views

postgresql 12.3 convert existing DB to use case-insensitive collation?

postgresql 12.3 in a container with Alpine Linux 3.10 I would like to convert an existing DB to use case-insensitive collation. Is it possible? I mean, without dropping it and recreating from scratch. ...
5
votes
1answer
217 views

Msg 6355 “Conversion of one or more characters from XML to target collation impossible” when querying sys.dm_exec_query_plan

I like to find missing indexes on the go, looking at the execution plans! It can potentially give me an indication where further to look at if I want to improve something that is currently running. ...
2
votes
1answer
43 views

Equivalent of utf8_general_ci in Postgres/ICU?

In MySQL there is a collation utf8_general_ci which provides case-insensitive comparisons in a variety of languages. For example, these are all 1 (true): SELECT 'ı' = 'I' SOLLATE 'utf8_general_ci'; ...
2
votes
1answer
57 views

Is there a difference between text_pattern_ops and COLLATE “C”?

If I have a text column name with a collation, for example tr-TR, and I run a query SELECT * FROM t WHERE name LIKE 'a%' then this will do a seq scan. If I now create an index CREATE INDEX ON t(name ...
2
votes
2answers
273 views

How to create a new column in SELECT CASE when string contains Arabic words?

I have a problem with a select case when statement, I would like to add a new column in the select case when statement, I got the result but with ????? because I have set the column to Arabic words, I ...
0
votes
2answers
68 views

Strange behavior of TOP 1 clause sql server

I have a SQL Server database and restored it on another server on a different machine. Now I run following same query on both DBs which produces same below result set. select person_id, visit_id, ...
0
votes
1answer
325 views

Cleaning up bad data with REGEXP_REPLACE too aggressive with non latin chars

Trying to use REGEXP_REPLACE to clean up a text field in a table. Here's my query: select title original ,REGEXP_REPLACE(title, '[^a-zA-Z0-9]+', ' ') clean from tmp_table2 WHERE txn_title like '%?%' ...
3
votes
3answers
260 views

to change collation for system database SQL Server 2017

We are using fresh SQL Server 2017 CU23 Standard Edition database with "SQL_Latin1_General_CP1_CI_AS". Now, I want to change all system databases (master , model , temp, msdb) to another ...
4
votes
1answer
2k views

What is default behavior of PostgreSQL without specifying COLLATION?

What is default behavior of PostgreSQL, if i don't specify collation externally? One of the main questions, is it case-sensitive or not?
4
votes
3answers
2k views

Case Insensitive ORDER BY clause using COLLATE

I have spent a long time looking for this, and I am getting mixed messages. In other DBMSs (tested in SQLite, Oracle, MariaDB, MSSQL) I can override the default sort order using the COLLATE clause: ...
18
votes
4answers
79k views

SQL Server 2005/2008 UTF-8 Collation/Charset

I can't find option(s) directly to set UTF-8 rellated Collations/Charsets in SQL Server 2005/2008, same as is possible to set in another SQL engines, but in SQL Server 2005/2008 are there only Latin ...
9
votes
2answers
8k views

Database collation different from tempdb collation

I just received the source code and database of an application from my client (it was developed by another company, from a different country) and the application is throwing some exceptions related to ...
1
vote
1answer
85 views

MySQL illegal mix of collations, ASCII to UTF-8

I have a MySQL 8.0 table like this, which is UTF-8 apart from one field, which holds an ASCII UUID that doesn't need UTF-8 overhead: CREATE TABLE `things` ( `id` bigint unsigned NOT NULL ...
3
votes
2answers
1k views

How do I fix the Code Page in SSIS Lookup Transformation to be 65001?

I have an SQL server 2019 with databases and tables all set with the collation Latin1_General_100_CI_AS_SC_UTF8. The relevant table has code and desc columns which are both of data type varchar. In ...
1
vote
2answers
147 views

Changing from utf8 to utf8mb4

MySql database at the moment has: Character Set: utf8 Default Collation Name: utf8_unicode_ci I want to change it to: utf8mb4 utf8mb4_unicode_ci I would also do the same thing for all tables in ...
6
votes
3answers
753 views

How to treat numbers within strings as numbers when sorting (“A3” sorts before “A10”, not after)

For all of these queries: SELECT label FROM personal.storage_disks ORDER BY label ASC; SELECT label FROM personal.storage_disks ORDER BY label COLLATE "C" ASC; SELECT label FROM personal....
1
vote
1answer
93 views

Is LC_COLLATE different from COLLATE?

Postgres 12 on Windows 7 This works: CREATE DATABASE "foo" ENCODING 'UTF8' LC_COLLATE = 'en-US' LC_CTYPE = 'en-US' TEMPLATE template0 Afterwards, running SHOW LC_COLLATE ...
1
vote
1answer
243 views

Does PostgreSQL handle case-insensitive database as good as others? [closed]

First things first, please forgive me if my question seems so naive (I am not a DBA). I look up to see how can I make PostgreSQL case-insensitive and I found the Nondeterministic Collations section of ...
27
votes
4answers
68k views

How to change SQL Server collation

How could I change the SQL Server 2008 R2 Express Default Collation for the whole server and a particular database? Is there a way to do it using visual interface of SQL Server Management Studio? In ...
1
vote
3answers
71 views

Handle development issues when dealing with different collation for the instance/database setting

Looking for some guidance on how we can handle the scripts/schemas when being run on different collation in sql server. We have a process where multiple stored procs are created lets say with schema ...
0
votes
1answer
78 views

Match similar special character in filters

I have to perform a search on a table with Turkish city names. The users would enter the first 4 characters of a city and I need to fetch the results from SQL. For example, user wants to find the ...
1
vote
3answers
337 views

Japanese characters in VARCHAR column using Japanese_Unicode_CI_AS

I am loading a table with the Japanese names from CSV file that are changing into question marks into SQL Table. The table that is storing these values is a varchar column. I understand that the ...
2
votes
1answer
91 views

postgres: do I really need to use Collate and Ctype when restoring database?

Need to import in Linux a Windows postgres exported database. In windows it's listed as follows: Name | Owner | Encoding | Collate | Ctype | Access privileges -----...
8
votes
1answer
406 views

Changing collation of SQL Database in Production environment to minimize downtime

We have a scenario in which we want to change the collation of our production database (including columns) from SQL_Scandinavian_Pref_CP850_CI_AS to Finnish_Swedish_CI_AS. We have developed scripts to ...
193
votes
2answers
416k views

Create a MySQL database with charset UTF-8

I'm new to MySQL and I would like to know: How can I create a database with charset utf-8 like I did in navicat? create mydatabase; ...seems to be using some kind of default charset.
4
votes
1answer
373 views

SQL Server with French_CI_AS Collation date conversion

I have a French installation of SQL Server using French_CI_AS Collation. For legacy reasons, a table column stores data as VARCHAR which is later converted to the right type, akin to variant in C++. ...
3
votes
1answer
358 views

What is the difference between different utf8mb4 binary collations?

What is the difference between utf8mb4_0900_bin vs utf8mb4_bin binary collations?
1
vote
1answer
408 views

ERROR: collation “database_default” for encoding “UTF8” does not exist

Moving application from SQL Server to PostgreSQL Database. I am getting this error from one of the queries used in a Java file: ERROR: collation "database_default" for encoding "UTF8&...
0
votes
1answer
319 views

Is it possible to specify a different collation for the data vs the entities within a single database?

I have a database with a case sensitive collation because the data inside of it should be treated as case sensitive in the context of how it's used. The entities and their column names within that ...
1
vote
4answers
903 views

Error “the system cannot find the file specified” when opening a large SQL Server file

I have generated the script of my whole SQL Server database into a file and it's more than 36 GB. When I try to open it, I get the following error: The system cannot find the file specified. At ...
1
vote
1answer
552 views

What is the SQL Server equivalent for Oracle character set AL32UTF8?

While porting data from oracle to Azure sql database I am facing the following issue where, empty data in Oracle is converted as ➞➞➞ in SQL Server Pic1: Data as in Oracle DB; Pic2: Data as in Sql ...
4
votes
2answers
351 views

Does MySQL 8 ASCII vs utf8mb4_0900_ai_ci size differ when only using ASCII characters?

If I only use only ASCII characters, will VARCHAR (255) with utf8mb4_0900_ai_ci be larger on disk than VARCHAR (255) using ASCII?
2
votes
2answers
2k views

How to join global temp tables in SQL Server?

I have four global temp tables (##A,##B,##C,##D) on which I want to perform a left join in SQL Server 2008. By global temp tables I mean I created them using a code like this: SELECT * INTO ##A ...
9
votes
3answers
1k views

Trigger to change Database collation on creation

I'm trying to create a Trigger, to alter collation of a database on its creation, but how can I catch the database name to use inside the trigger? USE master GO CREATE TRIGGER ...
1
vote
1answer
94 views

Change collation in easy way

I'm a developer and sometime I face with restoring a DB with a different collation than the server. Our application uses the tempdb too and as result some joins fail due of the different collation. So ...
1
vote
1answer
207 views

What would make a MySQL database create tables in a different collation other than its default?

I am adding tables to a Wordpress database on my localhost and it is changing my collation from utf8_general_ci to latin1_swedish_ci. I'm kinda stumped because I'm not familiar with working directly ...
3
votes
1answer
2k views

PostgreSQL nondeterministic collations are not supported for LIKE

I am using Postgresql v12. I created a collation like this: CREATE COLLATION ci (provider = icu, locale = 'tr_TR', deterministic = false); I used that collation in a table: create table testtable1 ...
2
votes
1answer
360 views

What is the meaning of “-x-icu” in PostgreSQL's “collates”?

I had this query: SELECT * FROM table ORDER BY label ASC; Since the labels are not in English, they didn't get sorted in the right order (ones beginning with "ö" were not in the bottom/end). I ...
5
votes
2answers
16k views

How to create Postgres DB with case insensitive collation

I am using the postgres version 9.4.1 64-bit on windows 7 64-bit. I need to create DB with the setting "case sensitive = OFF" but couldn't make this work. I refereed already many question on SO and ...
7
votes
2answers
6k views

What is the SQL Server equivalent of MySQL's utf8mb4 character set?

We have some web applications based on databases using utf8mb4 as character set and utf8mb4_Standard as collation. We saw that we can use any character we want with this setting. In SQL Server ...

1
2 3 4 5
7