数据库主外键约束

--增加表cw_users的外键约束fk_users_group,表中的group_id受表cw_users_group中的主键id约束
begin transaction
alter table cw_users add constraint fk_users_group
foreign key (group_id)
references cw_users_group([id]) on update cascade on delete cascade
commit transaction

posted @ 2015-09-25 23:55  Thinker_cxz  阅读(87)  评论(0编辑  收藏  举报