HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Upper or Lower Case Optimisation on MS SQL Server

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
caselowersqloptimisationserverupper

Problem

Does anyone know if MS SQL Server text queries are optimised for upper or lower case strings?

I read somewhere the it was uppercase, but cant seem to find the reference to it again. Of course if this is entierly wrong and no optimisation takes place, this would also be useful to know.

Thanks for your help.

CM

Solution

I would say it depends on your install of SQL server. The default ones that I have seen are case insensitive.

Run select serverproperty('SQLsortorderName') if you get back nocase_iso it would mean that your searches are case insensitive. So using UPPER would give you the same results, but it would add a bit more work on the CPU.

Context

StackExchange Database Administrators Q#15860, answer score: 6

Revisions (0)

No revisions yet.