I'm trying to create a trigger to update a contact's info in a repository when it's been changed.
CREATE TRIGGER contacts_f_tr
ON contacts_f
AFTER UPDATE
AS
BEGIN
---
---Update repository data
---
IF UPDATE (mail)
BEGIN
UPDATE mails
SET contact = inserted.name, mail = inserted.mail
WHERE mails.idcontact IN (SELECT mail FROM deleted) AND mails.tablecontact = 2
END
END
I'm quite new at this, and I got this errors:
The multi-part identifier "INSERTED.name" could not be bound.
The multi-part identifier "INSERTED.mail" could not be bound.