create procedure Emp_fy
(
@rows int,
@page int,
@tabName varchar(20)
)
as
declare @str varchar(2000)
set @str=‘select top ‘+STR(@rows)+’ * from
(select ROW_NUMBER() over(order by Emp_Id)as rownum,* from ‘+@tabName+’)
as A where rownum >’+STR(@rows*(@page-1))+’’
exec (@str)
SQL分页存储过程
最新推荐文章于 2022-01-06 17:50:31 发布