日期:2014-05-18 浏览次数:20541 次
CREATE TRIGGER delfiled on tablename1 FOR DELETE AS IF @@ROWCOUNT = 0 RETURN declare @id int,@ename varchar(50),@strdrop varchar(200) select @id=id from deleted select @ename=ename from deleted delete from tablename1 where fatherid=@id set @strdrop= 'alter table tablename2 drop column '+@ename+ ' ' exec (@strdrop)