collation

Why does SQL_Latin1_General_CP1_CI_AS sort number-sign before underscore?

本秂侑毒 提交于 2019-12-08 08:18:27
Following up on https://stackoverflow.com/a/32233795/14731 , I was surprised to discover that: DECLARE @SampleData TABLE (ANSI VARCHAR(50), UTF16 NVARCHAR(50)); INSERT INTO @SampleData (ANSI, UTF16) VALUES ('##MS_PolicyTsqlExecutionLogin##', N'##MS_PolicyTsqlExecutionLogin##'), ('_gaia', N'_gaia'); SELECT sd.ANSI AS [ANSI-SQL_Latin1_General_CP1_CI_AS] FROM @SampleData sd ORDER BY sd.ANSI COLLATE SQL_Latin1_General_CP1_CI_AS ASC; SELECT sd.UTF16 AS [UTF16-SQL_Latin1_General_CP1_CI_AS] FROM @SampleData sd ORDER BY sd.UTF16 COLLATE SQL_Latin1_General_CP1_CI_AS ASC; Results in: ANSI-SQL_Latin1

create collation of firebird(3.0.1) db error on windows but succeed on centos

不打扰是莪最后的温柔 提交于 2019-12-08 06:42:47
问题 I try to create a collation on a new database(firebird3.0.1 on windows. I follows the steps: create database 'c:\tmp\ebizmis.fdb' user 'SYSDBA' password '123456' default character set utf8 collation unicode; connect 'c:\tmp\ebizmis.fdb' user 'SYSDBA' password '123456'; create collation py for utf8 from UNICODE case insensitive 'LOCALE=zh'; in this step, prompting error: Statement failed, SQLSTATE = HY000 unsuccessful metadata update -CREATE COLLATION PY failed -Invalid collation attributes

ICU and string compare

一世执手 提交于 2019-12-08 05:37:39
问题 can anybody explain why the following compare are not equal? void CompareTest() { UErrorCode status = U_ZERO_ERROR; UChar ruleset[500]; *ruleset = 0; int32_t rlen = 0; UCollator *coll = ucol_open("de_DE", &status); static const UChar rules[] = L"&\\u0000 = '' = '-'"; int32_t len=(int32_t)u_strlen(rules); const UChar *defRules = ucol_getRules(coll, &rlen); if(rlen > 0) { u_strcpy(ruleset, defRules); } u_strcat(ruleset, rules); status = U_ZERO_ERROR; UCollator *collRule = ucol_openRules(ruleset

SQL Server : when to use collation and nvarchar

爱⌒轻易说出口 提交于 2019-12-08 05:25:01
问题 Currently my column datatype is varchar in my SQL Server table. I want to store both English and Chinese characters in my column. What steps do I have to follow to use collation, or do I have to change the datatype to NVARCHAR and insert with N' as unicode? If I have to use collation what collation I should use. Please help me in this 回答1: You are mixing two concepts: data type and encoding VARCHAR stores your data in chunks of 8 bit. basic characters are one chunk. But sometimes there is one

phpmyadmin displays japanese characters as a bunch of question marks even if i set charset and collation to utf8_unicode_ci

久未见 提交于 2019-12-08 05:06:15
问题 okee, I followed all instructions I could find here and i could display all kinds of multilingual characters on my pages... The problem is in phpmyadmin the japanese characters are replaced by question marks, as in a bunch of ???? ??? pieced together. I think there's a problem with my database's collation but I just wanted to verify that here. We've had this database set before on a default collation which is latin_swedish_ci and it already has a lot of data. Now we had to add some tables

Why does SQL_Latin1_General_CP1_CI_AS sort number-sign before underscore?

*爱你&永不变心* 提交于 2019-12-08 04:36:30
问题 Following up on https://stackoverflow.com/a/32233795/14731, I was surprised to discover that: DECLARE @SampleData TABLE (ANSI VARCHAR(50), UTF16 NVARCHAR(50)); INSERT INTO @SampleData (ANSI, UTF16) VALUES ('##MS_PolicyTsqlExecutionLogin##', N'##MS_PolicyTsqlExecutionLogin##'), ('_gaia', N'_gaia'); SELECT sd.ANSI AS [ANSI-SQL_Latin1_General_CP1_CI_AS] FROM @SampleData sd ORDER BY sd.ANSI COLLATE SQL_Latin1_General_CP1_CI_AS ASC; SELECT sd.UTF16 AS [UTF16-SQL_Latin1_General_CP1_CI_AS] FROM

MySQL Sort Order - Collation?

我只是一个虾纸丫 提交于 2019-12-08 02:51:44
问题 I'm having a difficult time sorting a char field in MySQL. The problem is that accented characters get mixed up with un-accented characters. For example: Abc Ábd Acc I thought it may have something to do with collation. So I changed the collation of my table to utf8-ut8_bin , after reading this post. Actually, I altered the table several times to various collations. No cigar. I should also add that, I don't mind the order of the sort as long as the sort doesn't result in a mixed list. In

Change collation on clustered index column in SQL 2005

随声附和 提交于 2019-12-07 17:55:25
问题 I have a Database that was created with an incorrect collation. I changed the collation of the database, but this left the individual columns with the incorrect collation also. This causes me a problem. So, I wrote a script to loop through and change the collation of the individual columns and this basically worked, except for a few columns that are part of a clustered index on their respective tables. These I cannot change. For example if I run: ALTER TABLE MyTable ALTER COLUMN MyColumn

Case-sensitive SQL differentiate between upper and lower case

扶醉桌前 提交于 2019-12-07 16:50:12
问题 I'm trying to have a request with a case sensitive result. For example in my database I have ABCdef abcDEF abcdef The request is SELECT * FROM table WHERE col = 'abcdef' but I have my 3 rows as result and I just want abcdef I try to find a solution with SELECT * FROM table WHERE col COLLATE Latin1_General_CS_AS = 'abcdef' COLLATE Latin1_General_CS_AS but I have this error: Unknown collation: 'Latin1_General_CS_AS'{"success":false,"error":"#1273 - Unknown collation: 'Latin1_General_CS_AS'"}

Japanese/Chinese language data in SQL Server table

一个人想着一个人 提交于 2019-12-07 16:37:46
问题 So I've got an interesting problem that I need help with faster than I can get my skills with SQL Server up to par. We have a table that contains a bunch of text, all of it in different languages. Most of this data appears correctly in the browser, however, anything in Chinese or Japanese gets completely mangled by the browser. This is an ASP.old app that we're using to display the data which comes from a server running MS SQL Server 2005. Before, we had this same problem and we solved it by