• λ我爱Aspx >> C#.Net >> bbs的数据结构和存储过程(三)_ASP实例
  • bbs的数据结构和存储过程(三)_ASP实例

  • :aspxer  Դ:internet  :2007-4-28 23:45:07  ؼ:asp,数据
  • /*************************************************************************/

    /* */

    /* procedure : up_GetPostedTopicList */

    /* */

    /* Description: 精华区贴子列表 */

    /* */

    /* Parameters: @a_intForumID : 版面id */

    /* @a_intPageNo: 页号 */

    /* @a_intPageSize: 每页显示数,以根贴为准 */

    /* */

    /* Use table: bbs , forum */

    /* */

    /* Author: bigeagle@163.net */

    /* */

    /* Date: 2000/2/14 */

    /* */

    /* History: */

    /* */

    /*************************************************************************/

    if exists(select * from sysobjects where id = object_id('up_GetPostedTopicList'))

    drop proc up_GetPostedTopicList

    go

    create proc up_GetPostedTopicList

    @a_intForumID int ,

    @a_intPageNo int ,

    @a_intPageSize int

    as

    /*定义局部变量*/

    declare @intBeginID int

    declare @intEndID int

    declare @intRootRecordCount int

    declare @intPageCount int

    declare @intRowCount int

    /*关闭计数*/

    set nocount on

    /*检测是否有这个版面*/

    if not exists(select * from forum where id = @a_intForumID)

    return (-1)

    /*求总共根贴数*/

    select @intRootRecordCount = count(*) from bbs where posted=1 and forumid=@a_intForumID

    if (@intRootRecordCount = 0) --如果没有贴子,则返回零

    return 0

    /*判断页数是否正确*/

    if (@a_intPageNo - 1) * @a_intPageSize > @intRootRecordCount

    Ҷƪл˵?
  • һƪbbs的数据结构和存储过程(二)_ASP实例
    һƪ存储过程使用大全_ASP技巧