访问 http://www.qqread.com/asp/2006/10/n222116.html
下面读取纪录的存储过程:<br>
<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
更多内容请看存储过程、网络存储—光纤通道、服务器存储专栏专题,或进入讨论组讨论。
<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
较早的文章:ALL IN ONE : 利用存储过程实现BBS树形结构的存储及有回复email通知(不必借助任何组件发Email)功能的实..._
较新的文章:An ASP Class for XML Data Transfer(vbs类生成xml文件),希望对大家有用
较新的文章:An ASP Class for XML Data Transfer(vbs类生成xml文件),希望对大家有用
相关图文阅读
频道图文推荐
健 康 咨 询
时 尚 咨 询
相关专题
- asp+ajax打造无刷新新闻评论系统 (846次浏览)
- 绝对免费顶级域名+免费500MB ASP?? (728次浏览)
- ASP后门之终极伪装 (601次浏览)
- FTP的安全问题 《转》 (589次浏览)
- 如何正确显示数据库中的图片 (503次浏览)
- 用户登录/注册程序——Flash+ASP (492次浏览)
- SQL注入漏洞全接触 (381次浏览)
- asp+sqlserver 分页方法(不用存储过程) (314次浏览)
- Windows操作系统出现死机故障的解决方法 (202次浏览)
- 对ASP 动态包含文件方法的改进 (152次浏览)



