• Good question - though I am waiting for the first person to claim that "error, error" should also be considered correct because they executed the code on a server or in a database with a case-sensitive collation.

    Too bad that the explanation does not contain a link to the Books Online page that explains why this query fails - after all, from a performance perspective it might make more sense to convert the numeric value to varchar (especially if the search column is also indexed) rather than perform all the varchar values in the table. The reason that a slower approach is chosen is documented here: http://msdn.microsoft.com/en-us/library/ms190309.aspx.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/