Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Select not case sensitive
Message
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:
01545330
Vues:
61
J'aime (1)
>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.

Collation is set per database and controlls case sensitivity among other things.

see http://sqlserver2000.databases.aspfaq.com/how-can-i-make-my-sql-queries-case-sensitive.html
____________________________________

Don't Tread on Me

Overthrow the federal government NOW!
____________________________________
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform