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