try:create trigger trg_delete_cpjlb on cpjlb for delete asdeclare @cpbs varchar(3),@tbhead varchar(5),@tbname varchar(6),@sqlcmd varchar(300)
select @cpbs=cpbs from deleteddeclare cursor1 cursor for select name from sysobjects where xtype='u' and name like 'B__'+@cpbs
declare
@i varchar(1000)
open cursor1
fetch cursor1 into @i
while @@fetch_status=0
begin
exec('drop table '+@i)
fetch cursor1 into @i
end
close cursor1
deallocate cursor1
select @cpbs=cpbs from deleteddeclare cursor1 cursor for select name from sysobjects where xtype='u' and name like 'B__'+@cpbs
declare
@i varchar(1000)
open cursor1
fetch cursor1 into @i
while @@fetch_status=0
begin
exec('drop table '+@i)
fetch cursor1 into @i
end
close cursor1
deallocate cursor1
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货