Why does this Trigger go off? - TechRepublic
General discussion
June 28, 2006 at 11:41 AM
rheal.dugas

Why does this Trigger go off?

by rheal.dugas . Updated 19 years, 11 months ago

I 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 You

CREATE 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.

This discussion is locked

All Comments