create procedure procPage @startIndex int,@endIndex int,@sort varchar(50)='asc'

as

with pageTamp as(

 select row_number() over(order by id @sort) as row,* from dbo.WZ_YouQing)

 select * from pagetamp where row between @startIndex and @endIndex

消息 102,级别 15,状态 1,过程 procPage,第 4 行
'@sort' 附近有语法错误。

- 上面这样写为什么错误呢?

只有下面这样写吗,有没有更简单的方法哦? 

 

Code


 

posted on 2009-10-08 17:15  黛玉  阅读(191)  评论(0编辑  收藏  举报