存儲過程中的問題
表结构如下: tree_eqs(id,parentid,content) 树结构
存储过程如下
CREATE PROCEDURE test12
@node int
AS
TRUNCATE TABLE tree_eqs_temp
declare @depth int
set @depth = 1
insert into tree_eqs_temp select *, @depth from tree_eqs Where parentid = @node
while @@ROWCOUNT > 0
begin
set @depth = @depth + 1
insert into tree_eqs_temp
select *, @depth
from tree_eqs Where Parentid in (select id from tree_eqs_temp WHERE depth=@depth-1)
end
begin
select id from tree_eqs_temp
end
GO
目地:显示指定节点下树中所有节点值
在asp执行中出现
• 错误类型:
ADODB.Recordset (0x800A0E78)
Operation is not allowed when the object is closed.
/deeptree/goto.asp, line 18
不知如何解决