//表插入CREATE TRIGGER INSERTDATE//INSERTDATE为触发器名称
ON A1 AFTER INSERT AS
BEGIN
INSERT INTOA2 (A2NAME) SELECT A1NAME FROM INSERTED
END
表同步插入
CREATE TRIGGER DELETEDATE//DELETEDATE 为触发器名
ON A1 AFTER DELETE ASBEGIN DELETE A2 WHERE A2 NAME IN(SELECT A1 NAME FROM DELETED)END//表同步删除CREATE TRIGGER UPDATEDATE //Updatedate为触发器名ON A1 AFTER UPDATE ASBEGIN UPDATE A2 SET A2.A2NAME=A1.A1NAME FROM A1 where A2.ID=A1.ID //将A1表内容传给A2END//表同步更新
//A1,A2,均为表名,A1NAME,ID为A1表列名,A2NAME,ID为A2表列名