日期:2014-05-18 浏览次数:20486 次
CREATE TRIGGER [TR_UPDATACPTK001] ON ACPTK FOR UPDATE,INSERT AS DECLARE @TD001 CHAR(04), @TD002 CHAR(11), @TD003 CHAR(04), @TD005 VARCHAR(60), @TD006 VARCHAR(60), @TD008 NUMERIC(16,6), @TD010 NUMERIC(17,8), @TK017 CHAR(4), @TK018 CHAR(11) BEGIN TRANSACTION SET NOCOUNT ON SELECT @TK017=TK017,@TK018=TK018 FROM INSERTED SELECT @TD001=TD001,@TD002=TD002,@TD003=TD003,@TD005=TD005,@TD006=TD006,@TD008=TD008,@TD010=TD010 FROM PURTD WHERE TD001=@TK017 AND TD002=@TK018 UPDATE ACPTK SET UDF02=@TD005,UDF03=@TD006,UDF52=@TD010,UDF53=@TD008 WHERE @TD003='0001' AND TK017=@TD001 AND TK018=@TD002 UPDATE ACPTK SET UDF04=@TD005,UDF05=@TD006,UDF54=@TD010,UDF55=@TD008 WHERE @TD003='0002' AND TK017=@TD001 AND TK018=@TD002 SET NOCOUNT OFF COMMIT TRANSACTION