zoukankan      html  css  js  c++  java
  • 删除 treeview Node节点 循环删除子节点 存储过程

    create  procedure  DeleteNote

     @Objid int--定义要删除树节点

     as

     declare @childID int  --声明变量

     declare cursors cursor local for select Objid from TableChart where parentid=@Objid      --local关键字全局游标

     open cursors

      fetch next from cursors into @childID     --取游标的值赋给变量

      while(@@FETCH_STATUS=0)                   --判断当前游标内是否存在值

      begin

        exec DeleteNote @childID                --递归调用存储过程把孩子节点的值赋给游标递归调用

        fetch next from cursors into @childID   --继续读取游标里面的内容

      end 

      close cursors

      deallocate cursors

    delete from TableChart where objid=@Objid    ----存储过程执行的删除方法

     

     

    。net交流
  • 相关阅读:
    DjangoContenttype
    高并发的详解及解决方案
    Django之路由系统
    Django之ORM
    Django form表单
    AJAX
    python之协程
    python八大排序算法
    python之路-进程
    网络基础
  • 原文地址:https://www.cnblogs.com/hcyblogs/p/4632480.html
Copyright © 2011-2022 走看看