collation

What is the difference between NVarchar, Bin collation, Bin2 collation?

天涯浪子 提交于 2019-12-18 17:24:29
问题 All 3 options are case and accent sensitive, and support Unicode. According to the documentation: NVarchar sorts and compares data based on the "dictionaries for the associated language or alphabet" (?) Bin sorts and compares data based on the "bit patterns" (?) Bin2 sorts and compares data based on "Unicode code points for Unicode data" (?) To make complex things simple, can I say that the Bin is an improvement of the NVarchar and the Bin2 is an improvement of the Bin; and unless I am

SQL Server - Convert varchar to another collation (code page) to fix character encoding

给你一囗甜甜゛ 提交于 2019-12-18 14:08:13
问题 I'm querying a SQL Server database that uses the SQL_Latin1_General_CP850_BIN2 collation. One of the table rows has a varchar with a value that includes the +/- character (decimal code 177 in the Windows-1252 codepage). When I query the table directly in SQL Server Management Studio, I get a gibberish character instead of the +/- character in this row. When I use this table as the source in an SSIS package, the destination table (which uses the typical SQL_Latin1_General_CP1_CI_AS collation),

phpmyadmin shows numbers or blob for mysql's utf8_bin callation columns?

雨燕双飞 提交于 2019-12-18 13:37:34
问题 I have a table with a varchar column. Its collation is set to utf8_bin. My software using this table and column works perfectly. But when I look at the content in phpmyadmin, I only see some hex values or [Blob xB]. Can I make phpmyadmin show the content correctly? Besides, when I set the collation to utf8_general_ci or utf8_unicode_ci, the phpmyadmin shows the content correctly. Thx Marc [edit]Hah, I found out, there is a small "+Options" link above every table in phpmyadmin. It opens

Choosing a binary collation that can differentiate between 'ss' and 'ß' for nvarchar column in Sql Server

和自甴很熟 提交于 2019-12-18 13:16:02
问题 As the default SQL_Latin1_General_CP1_CI_AS collation of SQL server can't differentiate between ss and ß , I want to change the collation of a specific column in a table to SQL_Latin1_General_CP437_BIN2 , as advised in here. However, I am not sure whether this is generally a good practice or not. Also I am not sure about the implications other than the following: Changing the sort order: As I am never sorting the data on this column, it might not be a problem for me. However, if you think

Choosing a binary collation that can differentiate between 'ss' and 'ß' for nvarchar column in Sql Server

我的未来我决定 提交于 2019-12-18 13:15:27
问题 As the default SQL_Latin1_General_CP1_CI_AS collation of SQL server can't differentiate between ss and ß , I want to change the collation of a specific column in a table to SQL_Latin1_General_CP437_BIN2 , as advised in here. However, I am not sure whether this is generally a good practice or not. Also I am not sure about the implications other than the following: Changing the sort order: As I am never sorting the data on this column, it might not be a problem for me. However, if you think

SQL Collation conflict when comparing to a column in a temp table

那年仲夏 提交于 2019-12-18 13:08:34
问题 I have a SQL query that compares a value in the database to a constant: SELECT * FROM my_table INNER JOIN #TempTable tem ON my_table.id = temp.id AND my_table.key = 'SOME STRING' And I get the error: Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation. How can I get around this? (without making changes to the database) UPDATE: I get this error even if I remove the last like (the string comparison)... 回答1: Seems your

Why is table CHARSET set to utf8mb4 and COLLATION to utf8mb4_unicode_520_ci

我们两清 提交于 2019-12-18 11:07:54
问题 I've recently noticed that, when ever I start a new WordPress project, my tables' collation automatically changes from utf8_unicode_ci (which I select when I create a new DB from phpMyAdmin) to utf8mb4_unicode_520_ci . Also, I've noticed in phpMyAdmin under “General Settings” that server connection Collation defaults to utf8mb4_unicode_520_ci . I'm running MySQL Server 5.7.17 and phpMyAdmin 4.6.6 on Ubuntu 17.04. My questions are following: Why is this happening? If possible, how do I prevent

How to insert an hebrew value into a mysql db in php

孤者浪人 提交于 2019-12-18 04:55:17
问题 I'm trying to insert an hebrew value into my mysql db, instead of hebrew the values looks like that. שדגשדכעשד The collation of the table is latin1_swedish_ci by default, I tried also to change to utf-8_general_ci, hebrew_bin, hebrew_general_ci but the result is still the same. In my code I'm using of course the meta tag to configure the charset: <meta charset="UTF-8"> And before my php query I added this line: mysql_query("SET NAMES utf8"); I'm viewing the result in the phpmyadmin.

What is the point of COLLATIONS for nvarchar (Unicode) columns?

拥有回忆 提交于 2019-12-18 03:19:33
问题 IVe read a lot about this. Still some questions : Im not talking about case sensitive here... If I have a char ( ש for example) and he is stored in nvarchar - which can hold anything , Why would I need collation here ? If I'm "FaceBook" and i need the ability to store all chars from all languages , What is the relationship between the collation and my nvarchar columns ? Thanks in advance. 回答1: Storing and representing characters is one thing, and knowing how to sort and compare them is

Converting mysql tables from latin1 to utf8

心已入冬 提交于 2019-12-17 22:19:39
问题 I'm trying to convert some mysql tables from latin1 to utf8. I'm using the following command, which seems to mostly work. ALTER TABLE tablename CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; However, on one table I get an error about a duplicate key entry. This is caused by a unique index on a "name" field. It seems when converting to utf8, any "special" characters are indexed as their straight english equivalent. For example, there is already a record with a name field value of "Dru"