日期:2014-05-18 浏览次数:20708 次
declare cur cursor for select * from tb
open cur
declare @s varchar(200)
declare @t int
set @t=2
fetch next from cur into @s
while @@fetch_status=0
begin
if left(@s,3)='产品码'
begin
if charindex('10560008',@s)>0 or charindex('10560009',@s)>0
set @t=1
else
set @t=2
delete from tb where current of cur
end
else
if @t=2
delete from tb where current of cur
fetch next from cur into @s
end
close cur
deallocate cur