• Hugo Kornelis (11/2/2011)


    michael.kaufmann (11/2/2011)


    Hm, do you have an explanation why the following code will return the exact same result? :crazy:

    My guess would be that your server has a default collation of Latin1_General_CI_AS. My server has Latin1_General_CS_AS as the default, and when I run your code, I get the row with id=4 returned.

    Yes that's it. When I first wrote the demo code for this question I created a new database with an explicit collation, and ran the SELECT query without an explicit COLLATE clause. After some thought, I decided that this made the code a bit too long and made the question sneakier than I would like, so I went with the shorter version with the explicit COLLATE. Perhaps I made the wrong decision there; the dependency on default collation is a good learning point.