1、已有表創建表外鍵:
alter table 表名 add constrain FK_約束名 foreign key([外鍵列]) references 主鍵表([主鍵列])
e.g
alter table cst_customer add constraint fk_industry_002 foreign key(cust_industry) references base_dict (dict_id);
1、已有表創建表外鍵:
alter table 表名 add constrain FK_約束名 foreign key([外鍵列]) references 主鍵表([主鍵列])
e.g
alter table cst_customer add constraint fk_industry_002 foreign key(cust_industry) references base_dict (dict_id);