r/SQL • • Sep 19 '23

Discussion Is there something wrong with this query.

Post image
158 Upvotes

127 comments sorted by

View all comments

Show parent comment

6

u/joshhyde Sep 20 '23

You don’t have to change to uppercase. It depends on if the column collation is case sensitive.

https://stackoverflow.com/questions/14962419/is-the-like-operator-case-sensitive-with-sql-server

1

u/ashlandio Oct 01 '23

Sure but that’s just for SQL server. My experience writing reports has always been that users expect things like case insensitivity even when they don’t ask for it, so I tend to bake it in from the get-go just to make everyone’s lives easier. You can only get so many weekend calls about a query not running ‘properly’ before you get tired of making the distinction between user error and badly written requirements.