Your trigger has one major flow.
When INSERT operation is performed the TRIGGER is fired for an operation, not for every inserted record.
The way your trigger is written it will only process your logic for one of the inserted records.
You should never read from INSERTED or DELETED into variables in triggers.
Here is example of how it should be done properly:
ALTER TRIGGER TR_Update_Interaction
AFTER INSERT AS
SET NOCOUNT ON;
SET notes = v.consignment
FROM cust_hist ch
JOIN inserted i
ON i.tkey = ch.tkey
JOIN VLoadnoteCarr v
ON v.load_note = i.primary_ref
Now, if it still doesn't update as expected, you need to analyse JOINs. Are they using relevant key columns?
"The only true wisdom is in knowing you know nothing"
"O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
(So many miracle inventions provided by MS to us...)How to post your question to get the best and quick help