CREATE PROC sp_DdAndDdMxDel @DdId varchar(8000) /* ============================================================ 功能: 图书信息删除 所属: 哈尔滨超软软件工程有限公司 参数: @DdId varchar(8000) : 被删除的订单编号 ============================================================ */ AS declare @FaxBzCount int set @FaxBzCount=0 declare @FaxBz varchar(50) set @FaxBz='F' declare cur1 Cursor for select FaxBz from Super_DdMx where DdId=@DdId open cur1 fetch next from cur1 into @FaxBz while @@fetch_status=0 begin if(@FaxBz='T') set @FaxBzCount=@FaxBzCount+1 --下一个条件 fetch next from cur1 into @FaxBz end if(@FaxBzCount=0) begin delete from Super_Dd where DdId=''+@DdId+'' delete from Super_DdMx where DdId=''+@DdId+'' end close cur1 deallocate cur1 GO
游标
最新推荐文章于 2024-09-17 14:08:20 发布