ALTER PROCEDURE [dbo].[aspnetpage_p]
(
@select varchar(1000),
@condition varchar(1000),
@pagesize int,
@CurrentPage int
)
AS
BEGIN
SET NOCOUNT ON;
declare @strsql varchar(1000)
set @strsql= @select +',identity(int) id0zsx into #temp '+@condition
set @strsql =@strsql + '
select * from #temp where id0zsx > '+convert(varchar,@pagesize*(@CurrentPage-1)) + ' and id0zsx <= '+ convert(varchar,@pagesize*@CurrentPage) + '
drop table #temp
'
exec(@strsql)
END
------------------------------------------------------------------------------------------
ALTER procedure [dbo].[fypro]
(@pagesize int,
@pageindex int,
@docount bit)
as
if(@docount=1)
select count(*) from pub_user_inf
else
begin
with temptbl as (
SELECT ROW_NUMBER() OVER ( order by userid asc)AS Row, username,logname,duty from pub_user_inf)
SELECT * FROM temptbl where Row between (@pageindex-1)*@pagesize+1 and (@pageindex-1)*@pagesize+@pagesize
end