AspNetPager是一个比较好的分页控件,该控件使用过程分页十分方便,过程如下: Create PROCEDURE [dbo].[pt_AspNetPager] ( @tableName varchar(255), -- 表名 @fieldName varchar(400)= '*', -- 字段名 @strWhere varchar(255) = Null, @fieldOrder varchar(100), --不能为空 @startIndex int, @endIndex int ) AS declare @strSQL varchar(4000) begin set @strSQL='WITH temp AS (SELECT ROW_NUMBER() OVER (ORDER BY '+@fieldOrder+') as row,'+@fieldName+' from '+@tableName if @strWhere<>'' SELECT @strSQL=@strSQL+' where '+@strWhere SELECT @strSQL=@strSQL+')' SELECT @strSQL=@strSQL+' SELECT * from temp where row between '+cast(@startIndex as varchar(10))+' and '+cast(@endIndex as varchar(10)) print @strSQL exec (@strSQL) END