• <label id="pxtpz"><meter id="pxtpz"></meter></label>
      1. <span id="pxtpz"><optgroup id="pxtpz"></optgroup></span>

        當(dāng)前位置:雨林木風(fēng)下載站 > 技術(shù)開發(fā)教程 > 詳細(xì)頁(yè)面

        存儲(chǔ)過(guò)程分頁(yè)

        存儲(chǔ)過(guò)程分頁(yè)

        更新時(shí)間:2022-05-08 文章作者:未知 信息來(lái)源:網(wǎng)絡(luò) 閱讀次數(shù):

        if exists(select * from sysobjects where ID = object_id("up_TopicList"))
           drop proc up_TopicList
        go

        create proc up_TopicList
                    @a_ForumID int , @a_intDays int , @a_intPageNo int , @a_intPageSize tinyint
           as
               declare @m_intRecordNumber int
               declare @m_intStartRecord  int
               select @m_intRecordNumber = @a_intPageSize * @a_intPageNo
               select @m_intStartRecord = @a_intPageSize * (@a_intPageNo - 1) + 1

               if @a_intDays = 0                      --如果不限定天數(shù)
                  begin
                        /*求符合條件記錄數(shù)*/
                        select "RecordCount" = count(*)                         
                               from BBS where Layer=1 and ForumID = @a_ForumID

                       /*輸出紀(jì)錄*/
                       /*首先定義可滾動(dòng)光標(biāo)*/
                       set rowcount @m_intRecordNumber
                       declare m_curTemp Scroll cursor
                               for
                                  select a.ID ,a.Title , d.UserName , a.FaceID ,
                                        'ContentSize' = datalength(a.Content) ,
                                        'TotalChilds' = (select sum(TotalChilds)
                                                                from BBS as b
                                                                where a.RootID = b.RootID) ,
                                        'LastReplyTime' = (select max(PostTime)
                                                                  from BBS as c
                                                                  where a.RootID = c.RootID)
                                        from BBS as a
                                             join BBSUser as d on a.UserID = d.ID
                                        where Layer=1 and ForumID = @a_ForumID
                                        order by RootID desc , Layer , PostTime
                       open m_curTemp
                       fetch absolute @m_intStartRecord from m_curTemp
                       while  @@fetch_status = 0
                              fetch next from m_curTemp

                       set rowcount 0
                       /*清場(chǎng)*/       
                       CLOSE m_curTemp
                       DEALLOCATE m_curTemp
                  end                      
                                  
               else                                --如果限定天數(shù)          

                  begin
                        /*求符合條件記錄數(shù)*/
                        select "RecordCount" = count(*)                         
                               from BBS where Layer=1 and ForumID = @a_ForumID
                                              and dateadd(day , @a_intDays , PostTime) > getdate()

                       /*輸出紀(jì)錄*/
                       /*首先定義可滾動(dòng)光標(biāo)*/
                       set rowcount @m_intRecordNumber
                       declare m_curTemp Scroll cursor
                               for
                                  select a.ID ,a.Title , d.UserName , a.FaceID ,
                                        'ContentSize' = datalength(a.Content) ,
                                        'TotalChilds' = (select sum(TotalChilds)
                                                                from BBS as b
                                                                where a.RootID = b.RootID) ,
                                        'LastReplyTime' = (select max(PostTime)
                                                                  from BBS as c
                                                                  where a.RootID = c.RootID)
                                        from BBS as a
                                             join BBSUser as d on a.UserID = d.ID
                                        where Layer=1 and ForumID = @a_ForumID
                                              and dateadd(day , @a_intDays , PostTime) > getdate()
                                        order by RootID desc , Layer , PostTime
                       open m_curTemp
                       fetch absolute @m_intStartRecord from m_curTemp
                       while  @@fetch_status = 0
                              fetch next from m_curTemp

                       set rowcount 0
                       /*清場(chǎng)*/       
                       CLOSE m_curTemp
                       DEALLOCATE m_curTemp
                  end                                                
        go


        注:若在asp中調(diào)用存儲(chǔ)過(guò)程的command對(duì)象為cm,則set rs=cm.execute,然后用set rs=rs.nextrecordset取下一條記錄。

        溫馨提示:喜歡本站的話,請(qǐng)收藏一下本站!

        本類教程下載

        系統(tǒng)下載排行

        主站蜘蛛池模板: 国产一精品一AV一免费孕妇| 无码人妻久久一区二区三区免费| h视频在线观看免费网站| 久久国产亚洲电影天堂| 日本免费中文字幕| 亚洲成A人片在线观看无码不卡| 久久国产福利免费| 国产亚洲成AV人片在线观黄桃| 中国一级特黄的片子免费| 亚洲精品乱码久久久久久| 精品视频一区二区三区免费| 亚洲av色影在线| 麻豆国产精品免费视频| 久久亚洲精品国产亚洲老地址| 永久黄网站色视频免费观看| 亚洲爆乳少妇无码激情| 亚洲av无码专区在线观看素人| 久久久精品视频免费观看| 亚洲VA中文字幕无码毛片| 免费观看激色视频网站(性色)| 亚洲砖码砖专无区2023| 免费又黄又爽的视频| aa毛片免费全部播放完整| 无码久久精品国产亚洲Av影片| 一级女人18毛片免费| 国产精品亚洲一区二区三区在线观看| 亚洲国产成人影院播放| 亚洲免费视频网站| 亚洲人成网站在线观看播放动漫| 免费看的成人yellow视频| 七次郎成人免费线路视频| 亚洲天堂中文资源| 日本xxwwxxww在线视频免费| 中文在线免费看视频| 亚洲免费人成视频观看| 免费午夜爽爽爽WWW视频十八禁| 久久免费高清视频| 亚洲国产欧美国产综合一区 | 免费无码又爽又刺激一高潮| 亚洲成a人片在线观看播放| 免费一级毛片在播放视频|