RobColborne
MIS
Hi
I wish to fire a trigger when a record is updated or inserted in a table. I want the trigger to take the unique ID field of the row being inserted/updated to use to match a row in another table to update a field.
I have the basics of the trigger accept that the trigger I have written updates all the rows in the target table. Which means although the trigger works it isn't very effecient.
How do I get access to the unique ID field of the record being inserted / updated so that it can update just the matching row in the target table?
So far I have:
Thanks
Rob
I wish to fire a trigger when a record is updated or inserted in a table. I want the trigger to take the unique ID field of the row being inserted/updated to use to match a row in another table to update a field.
I have the basics of the trigger accept that the trigger I have written updates all the rows in the target table. Which means although the trigger works it isn't very effecient.
How do I get access to the unique ID field of the record being inserted / updated so that it can update just the matching row in the target table?
So far I have:
Code:
Create Trigger PassportXP
on Data
for Insert, Update
as
Update Person
Set person.Passport = Data.Date
From Data, Person
Where person.Personid = Data.entityID
and Data.fieldID = '23'
Thanks
Rob