Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Select not case sensitive
Message
 
 
À
05/06/2012 10:13:23
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01545328
Message ID:
01545373
Vues:
49
This, that even the column names have to be matching in case, concerns me. I can deal with the values to be compared (by using UPPER()) but making sure that column names in my code match the names in tables will be a challenge.
I hope more SQL Servers do not have case sensitive set ON.

>Be very careful with case sensitive database settings. It affects EVERYTHING. So a field called FirstName MUST always be FirstName (firstname) is not equivalent.
>
>>Hi,
>>
>>I have been doing some tests in a stored procedure and noticed that the SQL Select is not case sensitive. For example,
>>
>>
>>-- Both statements below find the record.
>>select * from MyTable where EmailAddr = 'FirstName@gmail.com'
>>select * from MyTable where EmailAddr = 'fIrstNamE@GMAIL.com'
>>-- on so on. All find the record
>>
>>
>>My understanding is that this is defined by a global setting in SQL Server and this is what it is probably set in my copy of SQL Server. My question, when writing code for my SPs, should I rely on the fact that most SQL servers will be ok with not using case sensitive syntax? Or would it be wiser, to account for case in SQL Select statements? TIA.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform