"A sort column can include an expression , but when the database is in SQL COMPATIBILITY 90 or higher , the expression cannot resolve to a constant"?????
Code like this:
DROP TABLE plantig
go
CREATE TABLE plantig (a int not null, b int not null primary key)
go
INSERT plantig VALUES(8, 2)
INSERT plantig VALUES(7, 1)
INSERT plantig VALUES(6, 3)
go
SELECT 'half' = a/2 , b
FROM plantig
ORDER BY 'half', 5+5
Yes, I was able to run this code successfully on SQL 6.5.
I could even have:
ORDER BY 'ha' + 'lf', 5+5
It ran with out errors. It did sort by a/2, though.
And again, it is a piece of nonsense that should not be accepted. But even if it is nonsense, there were surely people who wrote like that. Not on purpose, but because they were sleepy distracted etc. So all of a sudden raising errors for it was a breaking change.