日期:2014-05-17 浏览次数:20578 次
ALTER DATABASE [MyDataBase]
SET COMPATIBILITY_LEVEL = 80;
GO
SELECT orderCol = 1, * FROM(select 1 myTable) SourceTable ORDER BY SourceTable.orderCol;
-- 可以通过
ALTER DATABASE [MyDataBase]
SET COMPATIBILITY_LEVEL = 90;
GO
SELECT orderCol = 1, * FROM(select 1 myTable) SourceTable ORDER BY SourceTable.orderCol;
-- 不可以通过
-- 求问不改兼容级别,不改代码,如何破?
ALTER DATABASE ttt
SET COMPATIBILITY_LEVEL = 90;
GO
SELECT orderCol=1, *
FROM(select 1 myTable) SourceTable
ORDER BY orderCol;
/*
orderCol myTable
1 1
*/
SELECT * FROM
(SELECT orderCol=1,*
FROM(select 1 myTable) SourceTable) SourceTable
ORDER BY SourceTable.orderCol