我正在尝试创建一个触发器,以在更改存储库时更新联系人信息。
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
我对此很陌生,我得到了这个错误:
The multi-part identifier "INSERTED.name" could not be bound.
The multi-part identifier "INSERTED.mail" could not be bound.