时间:2021-07-01 10:21:17 帮助过:3人阅读
执行结果:
第四种方式:用存储过程的方式进行分页
CREATE procedure page_Demo
@tablename varchar(20),
@pageSize int,
@page int
AS
declare @newspage int,
@res varchar(100)
begin
set @newspage=@pageSize*(@page - 1)
set @res=‘select * from ‘ +@tablename+ ‘ order by ArtistId offset ‘+CAST(@newspage as varchar(10)) +‘ rows fetch next ‘+ CAST(@pageSize as varchar(10)) +‘ rows only‘
exec(@res)
end
EXEC page_Demo @tablename=‘ArtistModels‘,@pageSize=3,@page=5
执行结果:
sqlserver的四种分页方式
标签:not dem arch div number nbsp art etc img