I have the following code that is generated by an unsupported app
SELECT ID, TYPE, ID FROM my_table t1 ORDER BY TYPE, ID
I can't change this, now it used to work fine on SQL2008R2 or below on DB's in compatability mode 80 but due to infrastructure/licensing changes we require to move to a more modern version of SQL which no longer allows for mode 80 and now generates this error:
Msg 209, Level 16, State 1, Line 1
Ambiguous column name 'ID'.
I'm aware it's because of the duplicated reference to the ID column but I can't alter what the app generates as TSQL, is there anything I can do at the DB\server level to have this execute without error?
PS: Yes we are working to replace this app