How to configure reference to be deleted on parent table update?

Posted by abatishchev on Stack Overflow See other posts from Stack Overflow or by abatishchev
Published on 2010-04-04T21:21:05Z Indexed on 2010/04/04 21:23 UTC
Read the original article Hit count: 204

I have two tables:

info: ID, fee_id

and

fee: ID, amount

and a reference between them (SQL Server 2008):

ALTER TABLE info WITH CHECK ADD CONSTRAINT FK_info_fee FOREIGN KEY(fee_id)
REFERENCES fee (ID)
ALTER TABLE info CHECK CONSTRAINT FK_info_fee
GO

How to configure this reference that way so a record in fee will be deleted if info.fee_id becomes NULL

© Stack Overflow or respective owner

Related posts about sql

Related posts about tsql