--批量删除以test的表开头的表 declare @name varchar(50) while(exists(select * from sysobjects where name like test%' )) begin select @name=name from sysobjects where name like test%' exec ('drop table '+@name) end…
create trigger tri_asbon asb for insert as begin declare @rk int declare @ck int declare @sid varchar(20) select @sid=商品代码 ,@rk =入库数量,@ck=出库数量 from inserted if not exists(select * from asb where 商品代码=@sid) insert into bsb(商品代码,数量) values(@sid,@rk-@ck…