update 触发器(当update表中某个字段时,执行其他操作)
-- ================================================-- Template generated from Template Explorer using:-- Create Trigger (New Menu).SQL---- Use the Specify Values for Template Parameters -- command (Ctrl-Shift-M) to fill in the parameter -- values below.---- See additional Create Trigger templates for more-- examples of different Trigger statements.---- This block of comments will not be included in-- the definition of the function.-- ================================================SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGO-- =============================================-- Author:<Author,,Name>-- Create date: <Create Date,,>-- Description:<Description,,>-- =============================================alter TRIGGER maininfor_update on T_BOOK_MAININFOR FOR update AS if update(housesit) and @@rowcount=1BEGIN update fe_app1026..T_FEE SET FWZL=Inserted.housesit from FE_APP1026..T_FEE inner join inserted on FE_APP1026..T_FEE.ywzh=Inserted.ywzhif @@error<>0 rollback transactionSET NOCOUNT ON;ENDGO
?