[MySql] Tabelle case sensitive

giovedì 29 maggio 2014 - 13.22
Tag Elenco Tags  C#  |  .NET 4.0  |  MySQL 5.5

svipla Profilo | Senior Member

Ciao a tutti
dopo avere trasferito un sito(asp.net) da un provider ad un altro, ho notato che le query su un db mysql sono case sensitive. Cioè, se ho una tabella che si chiama 'utenti' ed eseguo 'Select * from Utenti' mi da errore perchè non trova la tabella.
Come posso superare questo problema?
Grazie mille

alx_81 Profilo | Guru

>Ciao a tutti
ciao

>se ho una tabella che si chiama 'utenti' ed eseguo 'Select *
>from Utenti' mi da errore perchè non trova la tabella.
>Come posso superare questo problema?
Ma sei sicuro che il problema non sia altrove? In questo esempio che ti ho preparato non uso il Case sensitive per le sintassi SQL:
http://sqlfiddle.com/#!2/1f69d/1

>Grazie mille
di nulla!
Alessandro Alpi | SQL Server MVP
MCP|MCITP|MCTS|MCT

http://blogs.dotnethell.it/suxstellino
http://suxstellino.wordpress.com
http://mvp.microsoft.com/profiles/Alessandro.Alpi

svipla Profilo | Senior Member

Ciao
il problema è quello perchè se eseguo 'Select * from utenti' è ok, 'Select * from Utenti' mi dice: tabella Utenti non trovata

alx_81 Profilo | Guru

>Ciao
>il problema è quello perchè se eseguo 'Select * from utenti'
>è ok, 'Select * from Utenti' mi dice: tabella Utenti non trovata
dal fiddle che ti ho mandato non ho problemi di case sensitive sul nome degli oggetti..
ho provato a documentarmi un po' e ho trovato questo:

"In MySQL, databases correspond to directories within the data directory. Each table within a database corresponds to at least one file within the database directory (and possibly more, depending on the storage engine). Consequently, the case sensitivity of the underlying operating system plays a part in the case sensitivity of database and table names. This means database and table names are not case sensitive in Windows, and case sensitive in most varieties of Unix. One notable exception is Mac OS X, which is Unix-based but uses a default file system type (HFS+) that is not case sensitive. However, Mac OS X also supports UFS volumes, which are case sensitive just as on any Unix."

e ancora

"Although database and table names are not case sensitive on some platforms, you should not refer to a given database or table using different cases within the same statement"

sei sotto Unix/OSx con mysql per caso?

vedi se qui puoi impostare qualcosa:
"http://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html"


Alessandro Alpi | SQL Server MVP
MCP|MCITP|MCTS|MCT

http://blogs.dotnethell.it/suxstellino
http://suxstellino.wordpress.com
http://mvp.microsoft.com/profiles/Alessandro.Alpi

svipla Profilo | Senior Member

Ciao
Ho il sospetto che mysql si trovi su un server unix.
Il link non si apre.
Grazie mille per l'aiuto

alx_81 Profilo | Guru

>Il link non si apre.
riproviamo: http://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html

Alessandro Alpi | SQL Server MVP
MCP|MCITP|MCTS|MCT

http://blogs.dotnethell.it/suxstellino
http://suxstellino.wordpress.com
http://mvp.microsoft.com/profiles/Alessandro.Alpi
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5