表:
--删除节点
create procedure DeleteTreeNode_Pro
@ID int
as
declare Mycursor cursor local
for
select ID from TreeView_Table where PID=@ID
open Mycursor
declare @innerID int
Fetch next from Mycursor into @innerID
while(@@Fetch_Status=0)
begin
exec DeleteTreeNode_Pro @innerID
Fetch next from Mycursor into @innerID
end
close Mycursor
deallocate Mycursor
delete from TreeView_Table where ID=@ID