分布存储过程

alter proc dbo.Get_NewsByClass
(@startIndex int,
@endIndex int,
@Classid int,
)
as
set nocount on
begin
declare @indextable table(id identity(1,1),nid int)
set rowcount @endIndex
intsert into @indextable(nid) select ID from News where Classid=@Classid order by ID desc
select * from News o,@indextable t where o.ID=t.nid and t.id between @startIndex and @endIndex order by t.id
end
set nocount off

posted on 2009-04-24 10:35  Paul_  阅读(283)  评论(0编辑  收藏  举报

导航