6,129
社区成员
发帖
与我相关
我的任务
分享
alter table tb
add constraint fk_tb_tb1 foreign key(id)
references tb1(id)
go
--为ta创建主健
alter table ta add constraint pk_ta_id primary key (id)
go
--为tb创建外健,并指定级联删除
alter table tb add constraint fk_tb_aid foreign key (aid) references ta(id) on delete cascade