update 触发器:
if(OBJECT_ID('trigger_compost_up') is not null) drop trigger trigger_compost_up go create trigger trigger_compost_up on t_com_post -- 指定创建触发器的表 for update -- update 触发器,也可以写为 after update as declare @postid int declare @postName nchar(40) if UPDATE(name) begin select @postid = id from deleted select @postName = name from inserted update t_post_detailinfo set postName = @postName where postid = @postid end