I just realized that SQL server '='
comparator when used for text comparison is case insensitive. I have a few questions regarding this functionality:
lower
function to ensure the text comparison is insensitive till now. Is it still a good idea to follow the same?'='
operator defaulting to case insensitive comparison?In summary, comparisons are case sensitive if they involve a binary literal string or string expression, or a CHAR BINARY , VARCHAR BINARY , or BLOB column. Comparisons are not case sensitive if they involve only non-binary literal strings or string expressions, or CHAR , VARCHAR , ENUM , SET , or TEXT columns.
SQL Server is, by default, case insensitive; however, it is possible to create a case-sensitive SQL Server database and even to make specific table columns case sensitive. The way to determine if a database or database object is to check its "COLLATION" property and look for "CI" or "CS" in the result.
No, case sensitivity has nothing to do with the equals sign. Case sensitivity is determined by the collation for the database -- see the documentation for details.
The SQL keywords (SELECT, FROM, WHERE, etc.) are case-insensitive, yet they are frequently expressed in all capitals. Table and column names are case-sensitive in some settings.
No, case sensitivity has nothing to do with the equals sign.
Case sensitivity is determined by the collation for the database -- see the documentation for details.
Case sensitivity depends only on the collation.
You can specify the collation within each '='
operation
SELECT *
FROM [Table_1] a inner join
[Table_2] b on a.Col1=b.Col2 collate Modern_Spanish_CS_AI
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With