How to access deleted rows of a parent table in a child trigger

I have 3 tables (Main, Detail, SubDetail) with a cascade deletion ratio. also define AFTER Trigger on SubDetail to check some data.

SubDetail Trigger needs to connect to the detail table for some data, but in the case of the entry “Delete Part” I cannot access the Detail record.

Example:

SELECT * 
FROM DELETED JOIN Detail on DELETED.DetailId = Detail.Id

How to access a remote record of a detail table in a SubDetail trigger ???

UPDATE:

Why doesn't the table hint work in my script? he must do everything in one transaction

+4
source share
1 answer

, Defail, Detail, AFTER DELETE, . , INSTEAD OF

+1

All Articles