Well, I need help in the following:
I have a trigger to send email when an update is made, but I'm having a problem!
Whenever the table has update it is an entire grid that is loaded and sends emails to all the lines that contain the closed field = 1
I wanted to compare with the table when creating the cursor but I'm not succeeding!
Follow the trigger below!
ALTER TRIGGER [dbo].[TRI_fp_email] IN [dbo].[fp] for UPDATE ACE START SET NOCOUNT ON; IF EXISTS (SELECT * FROM inserted WHERE closed = 1) (in the case of a problem, DECLARE C_FP CURSOR for SELECT fpStamp FROM FROM WHERE Closed = 1 open C_FP FETCH NEXT FROM C_FP INTO @stamp WHILE @@ FETCH_STATUS = 0 START (In the event that it is not found on the server). (In the case that it is not in the system). EXEC dbo.emailVayFerias @ no2, @ email2, @stamp FETCH NEXT FROM C_FP INTO @stamp FINISH CLOSE C_FP DEALLOCATE C_FP final
I have tried this form but without success!
for SELECT i.fpStamp FROM insert i JOIN u_fp_temp f on f.fpstamp = i.fpstamp WHERE i.date = 1 and f.date = 0
Thanks for your help in advance!