ALTER PROCEDURE dbo.Pro_ProductsPage
(
@PageSize int,
@Currentindex int
)
AS
declare @a nvarchar(50)
declare @b nvarchar(50)
declare @c nvarchar(500)
set @a=convert(nvarchar,@PageSize)
set @b=convert(nvarchar,@PageSize*(@Currentindex-1))
set @c='select top '+@a+' * from FU_ProductsInfo where ProductsID not in (select top '+@b+' ProductsID from FU_ProductsInfo)'
set @c='select * from ('+@c+')k order by ProductsID desc'
execute sp_executesql @c
RETURN
(
@PageSize int,
@Currentindex int
)
AS
declare @a nvarchar(50)
declare @b nvarchar(50)
declare @c nvarchar(500)
set @a=convert(nvarchar,@PageSize)
set @b=convert(nvarchar,@PageSize*(@Currentindex-1))
set @c='select top '+@a+' * from FU_ProductsInfo where ProductsID not in (select top '+@b+' ProductsID from FU_ProductsInfo)'
set @c='select * from ('+@c+')k order by ProductsID desc'
execute sp_executesql @c
RETURN