set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[LC_Video_GetAllPageVideo]
(
@pagesize int,
@pageindex int,
@docount bit
)
as
set nocount on
if(@docount=1)
select count(VFID)
from LC_Video
where LC_Video.VFType=1
else
begin
declare @indextable table(ID int identity(1,1),nid int)
declare @PageLowerBound int
declare @PageUpperBound int
set @PageLowerBound=(@pageindex-1)*@pagesize
set @PageUpperBound=@PageLowerBound+@pagesize
set rowcount @PageUpperBound
insert into @indextable(nid)
select VFID
from LC_Video
where LC_Video.VFType=1
Order By VFUpdateTime desc
select O.*
from LC_Video O,@indextable t
where O.VFID=t.nid and t.id>@PageLowerBound and t.id<=@PageUpperBound
Order By O.VFUpdateTime desc
end
set nocount off