Asp.Net分页存储过程 SQL分页语句 一.比较万能的分页: sql代码: 1 2 3 select top 每页显示的记录数 * from topic where id not in (select top (当前的页数-1)×每页显示的记录数 id from topic order by id desc) order by id desc 需要注意的是在access中不能是top 0,所以如果数据只有一页的话就得做判断了.. 二.SQL2005中的分页代码: sql代码: 1 2 3…
SQL分页语句 一.比较万能的分页: sql代码: 1 2 3 select top 每页显示的记录数 * from topic where id not in (select top (当前的页数-1)×每页显示的记录数 id from topic order by id desc) order by id desc 需要注意的是在access中不能是top 0,所以如果数据只有一页的话就得做判断了.. 二.SQL2005中的分页代码: sql代码: 1 2 3 4 5 6 --讲查询…
高效分页存储过程 USE [db] GO /****** 对象: StoredProcedure [dbo].[p_Page2005] 脚本日期: // :: ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ----------------------------------------------------- create PROCEDURE [p_Page] @tblName varchar(), -- TableName…