ALTERTRIGGER replyTRIGGER ON dbo.recmsg FORINSERT AS declare@@usernumvarchar(20) declare@@usertextvarchar(1000) select@@usernum=usercallno,@@usertext=msg from inserted if@@usernum='106573096245' begin insert sendmsg (usercallno,msg,sndflg,res) values ('106573096245','ZF:'+@@usertext,0,'1') end
GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO
二.
如这个触发器:
CREATETRIGGER LUZL.dd NO CASCADE BEFORE UPDATEOF MODIFY_DATE ON LUZL.ITEM REFERENCING OLD AS o NEW AS n FOR EACH ROW MODE DB2SQL set n.modify_date =currenttimestamp