多级菜单删除
if exists (select * from sysobjects where name='proc_menu_delete') drop proc proc_menu_delete go create proc proc_menu_delete(@id int) as declare @count int,@tmpid int select @count=count(1) from Menu where Id=@id if(@count>0) begin declare ar_cursor cursor local for select id from menu where pid=@id open ar_cursor fetch next from ar_cursor into @tmpid while @@FETCH_STATUS=0 begin exec proc_menu_delete @tmpid fetch next from ar_cursor into @tmpid end close ar_cursor deallocate ar_cursor end delete Menu where Id=@id go