MySQL Forums
Forum List  »  Triggers

Re: Trigger to fire when condition met
Posted by: Elvento Labs
Date: September 04, 2016 05:59AM

Given that a WHERE clause did not work, maybe this will:

CREATE TRIGGER
[dbo].[SystemParameterInsertUpdate]
ON
[dbo].[SystemParameter]
FOR INSERT, UPDATE
AS
BEGIN
SET NOCOUNT ON

If (SELECT Attribute FROM INSERTED) LIKE 'NoHist_%'
Begin
Return
End

INSERT INTO SystemParameterHistory
(
Attribute,
ParameterValue,
ParameterDescription,
ChangeDate
)
SELECT
Attribute,
ParameterValue,
ParameterDescription,
ChangeDate
FROM Inserted AS I
END

Options: ReplyQuote


Subject
Views
Written By
Posted
1769
August 18, 2016 08:10PM
Re: Trigger to fire when condition met
880
September 04, 2016 05:59AM
781
September 04, 2016 11:57AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.