--例如
create table zb --主表
(
zb_id int  primary key,
)gocreate table  cb --从表
(
cb_id int   primary key 
            FOREIGN KEY REFERENCES zb(zb_id) ON DELETE CASCADE , --指定级联删除
)
go--主表数据
insert zb values(1)
insert zb values(2)
insert zb values(3)
--从表数据
insert cb values(1)
insert cb values(2)
insert cb values(3)
select * from zb
select * from cb
zb_id       
----------- 
1
2
3(所影响的行数为 3 行)mx_id       
----------- 
1
2
3(所影响的行数为 3 行)
--级联删除
delete from zb where zb_id = 1
select * from zb
select * from cb
zb_id       
----------- 
2
3(所影响的行数为 2 行)mx_id       
----------- 
2
3
(所影响的行数为 2 行)