Constant expressions are allowed (and ignored) in the ORDER BY clause when the database compatibility mode is set to 80 and ...

Constant expressions are allowed (and ignored) in the ORDER BY clause when the database compatibility mode is set to 80 and earlier. However, these expressions in the ORDER BY clause will cause the statement to fail when the database compatibility mode is set to 90 or later.

Here is an example of such problematic statements:

SELECT * FROM Production.Product
ORDER BY CASE WHEN  1=2 THEN 3 ELSE 2 END