--语句本身没问题啊:
create table stora_stock
( STID int identity(1,1) primary key,
  SID int not null,
  Pcode Char(15) not null,
  foreign key (SID) references stora_step (SID) On Update Cascade,
  foreign key (Pcode) references Product (Pcode) On Update Cascade,
)

解决方案 »

  1.   

    --下面是在我的电脑上的测试--辅助表
    create table stora_step(sid int primary key)
    create table Product(Pcode char(15) primary key)--楼主自己的语句
    create table stora_stock
    ( STID int identity(1,1) primary key,
      SID int not null,
      Pcode Char(15) not null,
      foreign key (SID) references stora_step (SID) On Update Cascade,
      foreign key (Pcode) references Product (Pcode) On Update Cascade,
    )
    go--显示是否创建了这些表
    select name from sysobjects where name in('stora_stock','stora_step','Product')
    go--删除测试表
    drop table stora_stock,stora_step,Product/*--测试结果
    name               
    -------------------
    Product
    stora_step
    stora_stock(所影响的行数为 3 行)--*/
      

  2.   

    特别注意,级联更新是SQL 2000中新增的功能.如果楼主的SQL版本是2000以下,是不能用级联更新的.即:在sql 7.0的环境下,上面的语句就错了.
      

  3.   

    哦, SQL 是7.0的版本
    原来不支持啊,真是晕
    谢谢了!