Hi,
I've done a bunch of research and am striking out here. I need to create a Delete Trigger. When the user deletes 1 or more rows in Table_A, I need to perform an Update operation on Table_B. But I need to retrieve the AutoNumber field from Table_A and do the Update on Table_B Where AutoNumber is the same. I have tried this, but it seems to update ALL records in Table_B:
CREATE TRIGGER Delete_Trg ON Table_A
FOR DELETE
AS
Update Table_B
Set Field=GetDate()
Where Table_B.AutoNumber in (select AutoNumber from deleted)
Thanks for any help !
Paul
I've done a bunch of research and am striking out here. I need to create a Delete Trigger. When the user deletes 1 or more rows in Table_A, I need to perform an Update operation on Table_B. But I need to retrieve the AutoNumber field from Table_A and do the Update on Table_B Where AutoNumber is the same. I have tried this, but it seems to update ALL records in Table_B:
CREATE TRIGGER Delete_Trg ON Table_A
FOR DELETE
AS
Update Table_B
Set Field=GetDate()
Where Table_B.AutoNumber in (select AutoNumber from deleted)
Thanks for any help !
Paul