A personal repository of random information in compensation for a fatigued biological computer
Breaded IT » MS Access / SQL Server reminders » SQL Server 2000: Table Triggers Targeted Procedures
SET QUOTED_IDENTIFIER ON GO SET ANSI_NULLS ON GO ALTER TRIGGER dbo.tbSubSection_UP ON tbSubSection FOR UPDATE AS IF EXISTS(SELECT DISTINCT 1 FROM INSERTED ins JOIN DELETED del ON del.suID = ins.suID AND NOT del.suDeleted = INS.suDeleted WHERE INS.suDeleted = 1) BEGIN EXEC DeleteUnnecessaryRelatedSubSectionRecords END ELSE IF EXISTS(SELECT * FROM INSERTED ins JOIN DELETED del ON del.suID = ins.suID AND NOT del.suDeleted = INS.suDeleted WHERE INS.suDeleted = 0) BEGIN EXEC GenerateTimeSectionRecords END GO |