2
我已經創建了一個簡單的刪除觸發器被觸發但0行生效。父表記錄被刪除。但從記錄表中也應該刪除而不刪除。我有以下查詢。刪除觸發器不工作
ALTER trigger [dbo].[studentAuditActionDelete] on [dbo].[tblStudent]
after delete
AS
declare @studentId_Audit int;
select @studentId_Audit = i.studentID from inserted i;
delete from studentAudit
where
studentId_Audit = @studentId_Audit
PRINT 'AFTER Delete trigger fired.'