装了个4月份的CTP SQL SERVER 2005版本,按照MSDN上试了下新的TOP的用法
可气的是,COPY代码到SQL SEVRER 2005的SQL语句解析器中运行时,居然说selet top(@)附近有错误,不能通过,
怎么回事呢?代码是COPY过去的,没错的呀。有无大侠试过呢?之后,再试了下如下的新用法,也是不行,说TOP(5)附近有
错误
CREATE TABLE TestingTop
(LineNumber INT, OrderQty INT)
/* Using TOP(n) with INSERT */
INSERT TOP(5) TestingTop
SELECT
LineNumber,
OrderQty
From Purchasing.PurchaseOrderDetail
SELECT * from TestingTop
USE AdventureWorks ; GO DECLARE @p AS int SET @p='10' SELECT TOP(@p)* FROM HumanResources.Employee; GO
可气的是,COPY代码到SQL SEVRER 2005的SQL语句解析器中运行时,居然说selet top(@)附近有错误,不能通过,
怎么回事呢?代码是COPY过去的,没错的呀。有无大侠试过呢?之后,再试了下如下的新用法,也是不行,说TOP(5)附近有
错误
CREATE TABLE TestingTop
(LineNumber INT, OrderQty INT)
/* Using TOP(n) with INSERT */
INSERT TOP(5) TestingTop
SELECT
LineNumber,
OrderQty
From Purchasing.PurchaseOrderDetail
SELECT * from TestingTop