频道直达 - 专题 - 新闻 - 技巧 - 组网 - 开发 - 安全 - web编程 - 图像 - 操作系统 - 数据库 - 教育 - 旅游 - 健康 - 时尚 - 驱动 - 软件 - 游戏 - 多媒体 - ERP - 讨论组

ALL IN ONE : 利用存储过程实现BBS树形结构的存储及有回复email通知(不必借助任何组件发Email)功能的实..._

来源: 作者: 出处:巧巧读书 2006-10-16 进入讨论组
    下面是上篇文章所说的存储过程,其作用已经说过,在这里就不再赘述了。请大家自己看代码吧。这个存储过程只是存储数据的过程,以后如果有时间我将讲一下读取数据。

/**********************************************************************/
/*                                                                    */
/*  Stored Procudure :  up_PostTopic                                  */
/*                                                                    */
/*  Description:        贴子存储及回复Email                           */
/*                                                                    */
/*  Author:             Bigeagle                                      */
/*                                                                    */
/*  date:               2000/7/25 凌晨                                */
/*                                                                    */
/*  History:            version 1.0 by BigEagle , 2000/7/25           */
/*                                                                    */
/**********************************************************************/
if exists (select * from sysobjects where id = object_id("up_PostTopic"))
   drop proc up_PostTopic
go

create proc up_PostTopic @a_intID int OUTPUT ,
       @a_intFatherID int , @a_intForumID int , @a_intUserID int ,
       @a_strTitle varchar(255) , @a_strContent text , @a_intFaceID tinyint ,
       @a_bIfEmail bit , @a_bIfSignature bit
   as
       declare @m_intTopicID int
       declare @m_intLayer   tinyint
       declare @m_intRootID  int
       declare @m_fOrderNum  float

       select @m_fOrderNum = power(2 , 30)      --初始化排序基数       

       /*首先判断是否有这个论坛,没有则退出*/
       if not exists (select * from BBSCategory where CategoryID = @a_intForumID)
          begin
                select @a_intID = 0
                return(0)
          end
       
       /*判断是新发贴子还是回应主题*/
       if @a_intFatherID = 0                    --没有父贴子,说明是新发贴子
               select @m_intLayer = 1 , @m_intRootID = 0
       else
          begin
               if not exists(select * from BBS where ID = @a_intFatherID)   --如果没发现父贴子
                  begin              
                       select 'TopicID' = 0
               return (0)
                  end
               else                                --如果发现父贴子,则取出层数和根ID
                  select @m_intLayer = La打开: http://www.qqread.com/asp/2006/10/n222115.html 更多文章 更多内容请看存储过程网络存储—光纤通道服务器存储专栏专题,或进入讨论组讨论。
收藏此文】【 】【打印】【关闭
相关图文阅读
频道图文推荐
健 康 咨 询
时 尚 咨 询
巧巧读书宗旨
相关专题
最新论坛文章
站内各频道最新更新文档
站内最新制作专题
热门关键字导读
Photoshop教 程照片处理 照片制作 PS快捷键 抠图
计 算 机 故 障XP系统修复
艺 术 与 设 计设计 流媒体 设计欣赏 边框
计 算 机 安 全ARP
站内频道文章精选
巧巧电脑频道编辑信箱  告诉我们您想看的专题或文章