ALL IN ONE:利用存储过程实现BBS树形结构的存储及有回复email通知功能的实现(三,完)
<br>
if exists(select * from sysobjects where ID = object_id("up_GetTopic"))<br>
drop proc up_GetTopic<br>
go<br>
<br>
create proc up_GetTopic @a_intID int<br>
as<br>
declare @m_intNextID int , @m_intProvID int , @m_intRootID int<br>
declare @m_intLayer int , @m_intForumID int<br>
select @m_intRootID = RootID , @m_intLayer = Layer , @m_intForumID = ForumID<br>
From BBS where ID = @a_intID --求指定记录RootID<br>
<br>
if @@rowcount = 0 --如果没有选定纪录,则退出<br>
return 0 <br>
<br>
select a.ID , a.Layer , a.ForumID , b.UserName , b.Email , b.ICQ , b.HomePage ,<br>
a.Title , a.Content , a.PostTime , a.FaceID , a.Hits<br>
from BBS as a <br>
join BBSUser as b<br>
on a.UserID = b.ID<br>
where RootID = @m_intRootID and Layer >= @m_intLayer<br>
order by RootID , OrderNum<br>
<br>
/*更新点击数*/<br>
update BBS Set Hits = Hits + 1 where ID = @a_intID<br>
go
Tags:
作者:佚名评论内容只代表网友观点,与本站立场无关!
评论摘要(共 0 条,得分 0 分,平均 0 分)
查看完整评论