级联更新、级联删除是指在建立主外键关系的时候设定的一个选项
主要是主表里数据发生变化时从表也跟着变化,但是只有更新和删除,没有插入
你可以在企业管理器里做,也可以写SQL 语句
alter table score
add constraint fk_score_xh foreign key(xh) references student(xh)
on update cascade on delete cascade

解决方案 »

  1.   

    alter table sales
    add constraint fk_sales_customerID foreign key(customerID) references bcustomer(customerID)
    on update cascade on delete cascade
      

  2.   

    alter table sales
    drop constraint  constraintname
    go
    alter table sales
    add  constraint  fk_bc
    foreign key(customerID)
    references  bcustomer(customerid)
    on update cascade
      

  3.   

    修正:
    alter table sales
    drop constraint  constraintname
    go
    alter table sales
    add  constraint  fk_bc
    foreign key(customerID)
    references  bcustomer(customerid)
    on update cascade on delete cascade