标签:
CREATE PROC innerProc ( @pageIndex INT , @pageSize int ) AS BEGIN DECLARE @strQureySql NVARCHAR(1000) --查询语句 DECLARE @strStartdNum VARCHAR(100) -- DECLARE @strEndNum VARCHAR(100) SET @strStartdNum=@pageSize*(@pageIndex-1)+1 SET @strEndNum=@pageIndex*@pageSize SET @strQureySql=‘ select * from ( select ROW_NUMBER() OVER (ORDER BY sm.ID desc) as number, sm.ID smid,sm.fatherid,sm.title,smf.id smfid,smf.SysMenu_ID FROM sysmenu sm LEFT JOIN SysModuleFunction smf ON sm.ID=smf.SysMenu_ID )t where number BETWEEN ‘+@strStartdNum +‘ and ‘+@strEndNum +‘‘ EXEC(@strQureySql) PRINT(@strQureySql) END EXEC innerProc 2,10 DROP PROC innerProc
标签:
原文地址:http://www.cnblogs.com/Echo529/p/4466757.html