这里的 primary key 与 foreign key 咋解决???
sbxlj 2004-09-14 05:21:45 create table customer
(custid int not null
check ( custid>0),
name char(20) not null
check(name <>' '),
shipline1 varchar(30) not null
default ' ',
...............
constraint customerpk primary key ( custid) ,
constraint customerstatus check ( ( status<>' ')or (creditlimit is null)))
这个表最后一句是什么意思?
上面这个表能成功创建,但下面这个表要用上面表的 custid 做外键就会出错
create table sale
( orderid int not null,
saledate date not null,
saletotal money not null,
custid int not null,
constraint salepk primary key (orderid )
constraint salecustfk foreign key (custid)
reference customer (custid))
错误提示:在关键字 'constraint' 附近有语法错误。
该怎么办?