I am trying to write a trigger that does the following:
When a record is inserted into ARTRAN then ARTRAN.TRANDESC is updated based on data from another table.
Here is what I have so far but it isn't firing.
UPDATE dbo.ARTran
SET TRANDESC = LEFT(S.Descr, 30)
FROM dbo.ARTran A
JOIN SOLINE S ON A.shipperid = S.shipperid and A.shipperlineref = S.lineref
JOIN INSERTED I ON A.shipperid = I.shipperid and a.shipperlineref = i.shipperlineref
WHERE A.shipperid <> '' and a.trandesc <> 'Trade Discount'
The join to SOLINE is correct even though the field names aren't the same.
Can someone tell me what I am missing?