I’m creating a trigger for a table, and I have the following statement:
UPDATE [dbo].ConsignmentTripBreakdown SET VehicleTypeID = CONVERT(bigint,LTRIM(RTRIM(VehicleType)))
WHERE [dbo].ConsignmentTripBreakdown.ID IN (SELECT ID FROM Inserted)
Problem is, there is no ‘ID’ field on the ConsignmentTripBreakdown – instead there’s a composite key on 3 fields. How would I rework the where clause for this?
1 Answer