collation

MySQL: Converting datatypes and collations effect on stored data

╄→гoц情女王★ 提交于 2019-12-23 03:06:33
问题 I have a general question about this. There are many times we want to change data-types of fields or collations when lots of data is inserted before . Consider these situations : converting varchar collation from utf8_general_ci to latin1_swedish_ci : as I know the first has multibyte chars and the second singly byte ones. Does this conversion manipulate stored records correctly? And does this conversion lead to reduction of volume of existing data (maybe 50%)? Conversion of int(10) to

SQL Server 2008 Database Collation conversion

让人想犯罪 __ 提交于 2019-12-22 15:07:07
问题 I'd like to configure Database with the exact requirement collation of " Latin1_General_CP1_CI_AS " but for some reason in SQL Server 2008, i can only select " SQL_Latin1_General_CP1_CI_AS " ? how can I select the proper collation and change it from SQL_Latin1_General_CP1_CI_AS into Latin1_General_CP1_CI_AS ? while retaining all of the data and the settings (schema and logins , etc... ? Thanks. 回答1: Try to change collation from QA: ALTER DATABASE DBNAME COLLATE Cyrillic_General_CI_AS You can

Join column with different collation issue

China☆狼群 提交于 2019-12-22 14:57:08
问题 I am using SQL Server 2005. I have two tables, and they are using different collations. It is not allowed to concatenate columns from tables with different collations, for example the following SQL is not allowed, select table1column1 + table2column2 from ... My question is, why concatenation of two columns from different collations is not allowed from database engine design perspective? I do not know why collation will impact results, the result is just concatenating strings -- should be

SQL Server 2005 collation issue

自作多情 提交于 2019-12-22 12:49:11
问题 I have two tables, and they are using different collations. It is not allowed to concatenate columns from tables with different collations, for example the following SQL is not allowed, select table1column1 + table2column2 from ... My question is, how to change the collation of a table without destroying the data of the table? thanks in advance, George 回答1: You can change columns collation on the fly if you need to. E.g. select table1column1 collate database default + table2column2 collate

Case sensitive variable names in SQL Server? [closed]

偶尔善良 提交于 2019-12-22 10:05:44
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . When I execute this format of SQL command: SP_HELPTEXT Sproc1 . The result set will display Could not find stored procedure 'SP_HELPTEXT' . But if i will replace the SQL command to lower case like sp_helptext Sproc1 , it definitely displays the content of Sproc1. Im using the Sproc1 in my program and when the

MySQL's INSTR and collations

岁酱吖の 提交于 2019-12-22 09:51:52
问题 EDIT 3: OK, forget all the complicated stuff below. My question is as easy as this: Why is the second column of the following result set 0 while all other columns are 1. SELECT 'a' = 'á', INSTR('András','Andras'), 'András' LIKE 'Andras', INSTR('András','Andräs') The database and connection is set to utf8. END EDIT I've got an issue with MySQL's INSTR function. I have a table 'values' with collation utf8_general_ci and a VARCHAR column 'value' containing the value 'András Schiff'. Now I

MySQL search with uft8_general_ci is case sensitive for FULLTEXT?

 ̄綄美尐妖づ 提交于 2019-12-22 09:48:04
问题 I set up a MyISAM table to do FULLTEXT searching. I do not want searches to be case-sensitive. My searches are along the lines of: SELECT * FROM search WHERE MATCH (keywords) AGAINST ('+diversity +kitten' IN BOOLEAN MODE); Let's say the keywords field I'm looking for has the value "my Diversity kitten". I noticed the searches were case-sensitive. I double-checked my collation on the search table, it was set to utf8_bin . D'oh! I changed it to utf8_general_ci . But my query is still case

SQL-Server is ignoring my COLLATION when I'm using LIKE operator

耗尽温柔 提交于 2019-12-22 08:46:11
问题 I'm working with Spanish database so when I'm looking for and "aeiou" I can also get "áéíóú" or "AEIOU" or "ÁÉÍÓÚ", in a where clause like this: SELECT * FROM myTable WHERE stringData like '%perez%' I'm expencting: * perez * PEREZ * Pérez * PÉREZ So I changed my database to collation: Modern_Spanish_CI_AI And I get only: * perez * PEREZ But if I do: SELECT * FROM myTable WHERE stringData like '%perez%' COLLATE Modern_Spanish_CI_AI I get all results OK, so my question is, why if my database is

How to set a collation with mysqli?

爷,独闯天下 提交于 2019-12-22 07:01:42
问题 My database uses utf8_czech_ci collation and I want to set it to my database connection too. Mysqli_set_charset won't let me set collation, if I don't happen to want the default one, utf8_general_ci. Here was suggested first to set the charset through mysqli_set_charset and then to set collation by SET NAMES. So I did it and connection collation is still utf8_general_ci. EDIT: now I basically use the code YourCommonSense suggested: $spojeni=mysqli_connect('mysql01','username','password', 'my

How to emulate MySQLs utf8_general_ci collation in PHP string comparisons

允我心安 提交于 2019-12-21 12:55:38
问题 Basically, if two strings would evaluate as the same in my database I'd also like to be able to check that at the application level. For example, if somebody enters "bjork" in a search field, I want PHP to be able to match that to the string "Björk" just as MySQL would. I'm guessing PHP has no direct equivalent to MySQL's collation options, and that the easiest thing to do would be to write a simple function that converts the strings, using strtolower() to make them uniformly lower-case and