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
/*清场*/
CLOSE m_curTemp
DEALLOCATE m_curTemp
end
go
注:若在asp中调用存储过程的command对象为cm,则set rs=cm.execute,然后用set rs=rs.nextrecordset取下一条记录。
上一页 [1] [2]