General discussion
-
Topic
-
Why does this Trigger go off?
LockedI have created a SQL trigger that should only work if both fields are updated. Can someone tell me why when ony one field is uptated that this trigger goes off.
Thank YouCREATE TRIGGER send_update_request
on dbo.ONSA_NSS
FOR UPDATE
AS
— Send a Update request to the owning ONSA/AGENT
Declare @ID NVARCHAR (4000)
Declare @subject NVARCHAR (100)
Declare @too NVARCHAR (100)IF NOT UPDATE (requestsent) AND NOT UPDATE (sentagaintimes)
BEGIN
RETURN
END
SELECT @too = (SELECT updateemail FROM Inserted)
SELECT @subject = (SELECT ‘REQUEST LOG UPDATE’ FROM Inserted)
SELECT @ID = (SELECT ‘You Log Number ‘ +
Log_ID +’
‘+ ‘has not been update in 12 days.
All Comments
Viewing 1 reply thread