关于外键约束的删除
如下语句中。create table forerefer
(id int primary key,
department varchar(200)
)
go
create table refer
( forereferid int references forerefer(id),
address varchar(200)
)
insert into forerefer values(1,'admin')
insert into forerefer values(3,'sunshine')
insert into forerefer values(5,'window xp')
insert into refer values(1,'广州市')
insert into refer values(3,'深圳市')
insert into refer values(5,'珠海市')
有没有办法,当在forerefer中删除id为5的记录,会自动删除refer表中的forereferid为5的记录呢?