RobColborne
MIS
I'm trying to create a trigger that will change part of a text field.
So, because I can't use text fields from the Inserted table the plan was to copy the inserted fields to a table using a join.
So I have the following code, but it won't update the text field, but does update the id field. Any idea?
Thanks
So, because I can't use text fields from the Inserted table the plan was to copy the inserted fields to a table using a join.
So I have the following code, but it won't update the text field, but does update the id field. Any idea?
Thanks
Code:
CREATE TRIGGER TRG_UpdateMailboxTemp ON [dbo].[MAILBOX]
for INSERT
as
BEGIN
--Delete the rows from the table, should only have 1 row
truncate table mailboxupdate
--Copy the details of the email to a temporary holding table
insert into mailboxupdate
Select recid, rfc822
from inserted i
join mailbox m on i.recid = m.recid
END