I have 3 tables tblEnquiry, tblExempt, tblAppeal
tblEnquiry is the parent with primary key EnquiryID
tblExempt/tblAppeal have foreign keys set-up to EnquiryID
I now can't delete a record on tblEnquiry where a record exist in one of the other tables. fine ?(i hope) so can i create a trigger that says if the record is deleted in tblEnquiry it cascades down to the other two ?
any help appreciated
thanks
kim
i tried something like
CREATE TRIGGER tg_cascadedelete ON [dbo].[tblEnquiry]
AFTER DELETE
AS
DELETE FROM tblExempt WHERE EnquiryID = tblEnquiry.EnquiryID
tblEnquiry is the parent with primary key EnquiryID
tblExempt/tblAppeal have foreign keys set-up to EnquiryID
I now can't delete a record on tblEnquiry where a record exist in one of the other tables. fine ?(i hope) so can i create a trigger that says if the record is deleted in tblEnquiry it cascades down to the other two ?
any help appreciated
thanks
kim
i tried something like
CREATE TRIGGER tg_cascadedelete ON [dbo].[tblEnquiry]
AFTER DELETE
AS
DELETE FROM tblExempt WHERE EnquiryID = tblEnquiry.EnquiryID