>CREATE TRIGGER CheckPK ON [Product] >FOR UPDATE >AS >DECLARE @countFk int >SELECT @countFk = SELECT count(fk_product) from Traveler where fk_product = insert.pk) > >IF @countFk > 0 > AND (fk_engine != insert.fk_engine > OR fk_stage != insert.fk_stage > OR fk_part != insert.fk_part) >BEGIN >PRINT ‘Cannot change Products that have dependents’ >PRINT ‘Transaction has been cancelled’ >ROLLBACK >END > >Margaret,
SELECT @countFk = SELECT count(fk_product) from Traveler where fk_product = deleted.pk)and then act accordingly. Also do you want to check if you changed fk_engine, etc. fields? If yes, then join deleted with inserted tables based on the PK.