2

Are Table names in a Query supposed to be Case-SensitIvE in MySQL?

For example, if I do the following:

var query = "SELECT something FROM thAt WHERE this = '". $everything ."'";

If the actual table name is all lowercase, and I use a combination of upper and lowercase in my select query, SHOULD it match? Is table names in queries supposed to be case-(in)sensitive?

Michael Petrotta
  • 59,888
  • 27
  • 145
  • 179
βӔḺṪẶⱫŌŔ
  • 1,276
  • 3
  • 17
  • 33
  • possible duplicate of [Is SQL syntax case sensitive?](http://stackoverflow.com/questions/153944/is-sql-syntax-case-sensitive) – Daniel Pryden Apr 10 '11 at 04:32

2 Answers2

8

From < Is SQL syntax case sensitive? >:

Mysql has a configuration option to enable/disable it. Usually case-sensitive table and column names are the default on Linux MySql and case-insensitive used to be the default on Windows, but now the installer asked about this during setup. For MSSQL it is a function of the database's collation setting.

Here is the MySql page about name case-sensitivity: http://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html

Here is the article in MSDN about collations for MSSQL: http://msdn.microsoft.com/en-us/library/ms143503(SQL.90).aspx

Community
  • 1
  • 1
Mark Cidade
  • 98,437
  • 31
  • 224
  • 236
3

As per the documentation here, case sensitivity of table names is filesystem-dependent. On Windows, they are case insensitive.

kqnr
  • 3,596
  • 19
  • 17