| nbsp; @SPintRootRecordCount=@intRootRecordCount OUTPUT
select @RecordCount = @intRootRecordCount
if (@intRootRecordCount = 0) --如果没有贴子,则返回零 return 0 /*判断页数是否正确*/ if (@a_intPageNo - 1) * @a_intPageSize > @intRootRecordCount return (-1)
/*求开始rootID*/ set @intRowCount = (@a_intPageNo - 1) * @a_intPageSize + 1 /*限制条数*/
select @TmpSelect = 'set nocount on;set rowcount @SPintRowCount;select @SPintBeginID = '+@a_SelectOrderId+' from '+@a_TableName+' '+@a_SelectWhere+' '+@a_SelectOrder execute sp_executesql @TmpSelect, N'@SPintRowCount int,@SPintBeginID int OUTPUT', @SPintRowCount=@intRowCount,@SPintBeginID=@intBeginID OUTPUT
/*结束rootID*/ set @intRowCount = @a_intPageNo * @a_intPageSize /*限制条数*/
select @TmpSelect = 'set nocount on;set rowcount @SPintRowCount;select @SPintEndID = '+@a_SelectOrderId+' from '+@a_TableName+' '+@a_SelectWhere+' '+@a_SelectOrder execute sp_executesql @TmpSelect, N'@SPintRowCount int,@SPintEndID int OUTPUT', &nb << 上一页 [11] [12] [13] 下一页 |