• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • 一個高效的數據分頁的存儲過程 可以輕松應付百萬數據

    發表于:2008-10-20來源:作者:點擊數: 標簽:數據
    關鍵字:高效的數據分頁的存儲過程 CreatePROCEDUREpageTest--用于翻頁的 測試 --需要把排序字段放在第一列 ( @FirstIDnvarchar(20)=null,--當前頁面里的第一條記錄的排序字段的值 @LastIDnvarchar(20)=null,--當前頁面里的最后一條記錄的排序字段的值 @isNe
    關鍵字:高效的數據分頁的存儲過程
    Create PROCEDURE pageTest --用于翻頁的測試
    --需要把排序字段放在第一列
    (
    @FirstID nvarchar(20)=null, --當前頁面里的第一條記錄的排序字段的值
    @LastID nvarchar(20)=null, --當前頁 面里的最后一條記錄的排序字段的值
    @isNext bit=null, --true 1 :下一頁;false 0:上一頁
    @allCount int output, --返回總記錄數
    @pageSize int output, --返回一頁的記錄數
    @CurPage int --頁號(第幾頁)0:第一頁;-1最后一頁。
    )

    AS

    if @CurPage=0
    begin
    --統計總記錄數
    select @allCount=count(ProductId) from Product_test 

    set @pageSize=10
    --返回第一頁的數據
    select top 10 
    ProductId,
    ProductName,
    Introduction 
    from Product_test order by ProductId 
    end

    else if @CurPage=-1

    select * from 
    (select top 10 ProductId,

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>